Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-07-07 09:04:36 +0300
committerJunio C Hamano <gitster@pobox.com>2020-07-07 23:07:27 +0300
commitc96050ff3442067e5848501f25f44a51606f0634 (patch)
tree6a7afe9e60728da7ab62c72f7148ae72c0a9a692 /t/t7107-reset-pathspec-file.sh
parent6861ac806b98076121ea69ed41476b14818f07d6 (diff)
t7107: don't use test_must_fail()
We had a `test_must_fail verify_expect`. However, the git command in verify_expect() was not expected to fail; the test_cmp() was the failing command. Be more precise about testing failure by accepting an optional first argument of '!' which causes the result of the file comparison to be negated. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7107-reset-pathspec-file.sh')
-rwxr-xr-xt/t7107-reset-pathspec-file.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh
index cad3a9de9e..15ccb14f7e 100755
--- a/t/t7107-reset-pathspec-file.sh
+++ b/t/t7107-reset-pathspec-file.sh
@@ -22,7 +22,12 @@ restore_checkpoint () {
verify_expect () {
git status --porcelain -- fileA.t fileB.t fileC.t fileD.t >actual &&
- test_cmp expect actual
+ if test "x$1" = 'x!'
+ then
+ ! test_cmp expect actual
+ else
+ test_cmp expect actual
+ fi
}
test_expect_success '--pathspec-from-file from stdin' '
@@ -131,7 +136,7 @@ test_expect_success 'quotes not compatible with --pathspec-file-nul' '
cat >expect <<-\EOF &&
D fileA.t
EOF
- test_must_fail verify_expect
+ verify_expect !
'
test_expect_success 'only touches what was listed' '