2006-02-21 23:48:30 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006 Carl D. Worth
|
|
|
|
#
|
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
test_description='git ls-files test for --error-unmatch option
|
2006-02-21 23:48:30 +03:00
|
|
|
|
2007-07-03 09:52:14 +04:00
|
|
|
This test runs git ls-files --error-unmatch to ensure it correctly
|
2006-02-21 23:48:30 +03:00
|
|
|
returns an error when a non-existent path is provided on the command
|
|
|
|
line.
|
|
|
|
'
|
2021-10-07 13:01:35 +03:00
|
|
|
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2006-02-21 23:48:30 +03:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
2010-03-20 11:29:11 +03:00
|
|
|
test_expect_success 'setup' '
|
|
|
|
touch foo bar &&
|
|
|
|
git update-index --add foo bar &&
|
|
|
|
git commit -m "add foo bar"
|
|
|
|
'
|
2006-02-21 23:48:30 +03:00
|
|
|
|
2022-07-03 18:49:09 +03:00
|
|
|
test_expect_success 'git ls-files --error-unmatch should fail with unmatched path.' '
|
|
|
|
test_must_fail git ls-files --error-unmatch foo bar-does-not-match
|
|
|
|
'
|
2006-02-21 23:48:30 +03:00
|
|
|
|
2022-07-03 18:49:09 +03:00
|
|
|
test_expect_success 'git ls-files --error-unmatch should succeed with matched paths.' '
|
|
|
|
git ls-files --error-unmatch foo bar
|
|
|
|
'
|
2006-02-21 23:48:30 +03:00
|
|
|
|
|
|
|
test_done
|