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