summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 49cc460)
raw | patch | inline | side by side (parent: 49cc460)
author | Thomas Rast <trast@student.ethz.ch> | |
Thu, 29 Jul 2010 15:10:22 +0000 (17:10 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 9 Aug 2010 16:15:01 +0000 (09:15 -0700) |
The test would not fail if the filtering failed to do anything, since
in
test -z "$(git diff HEAD directorymoved:newsubdir)"'
'directorymoved:newsubdir' is not valid, so git-diff fails without
printing anything on stdout. But then the exit status of git-diff is
lost, whereas test -z "" succeeds.
Use 'git diff --exit-code' instead, which does the right thing and has
the added bonus of showing the differences if there are any.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in
test -z "$(git diff HEAD directorymoved:newsubdir)"'
'directorymoved:newsubdir' is not valid, so git-diff fails without
printing anything on stdout. But then the exit status of git-diff is
lost, whereas test -z "" succeeds.
Use 'git diff --exit-code' instead, which does the right thing and has
the added bonus of showing the differences if there are any.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7003-filter-branch.sh | patch | blob | history |
index 0da13a8d6b8f75ba041a353dfc6a356c1e8bbed0..fd7e3a113c9e3fcedc1c18c0b1a87a2c0ffef15b 100755 (executable)
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
- test -z "$(git diff HEAD directorymoved:newsubdir)"'
+ git diff --exit-code HEAD directorymoved:newsubdir
+'
test_expect_success 'stops when msg filter fails' '
old=$(git rev-parse HEAD) &&