summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-07-29 15:10:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-09 16:15:01 (GMT)
commit3c8710aeaa81a70ecad9facfc332d843ee37de35 (patch)
tree4b7e473d63d36ae4d3bdd1263961da2db2bc7288
parent49cc460d88f5bae79b45ce2db16674f36b6cf38a (diff)
downloadgit-3c8710aeaa81a70ecad9facfc332d843ee37de35.zip
git-3c8710aeaa81a70ecad9facfc332d843ee37de35.tar.gz
git-3c8710aeaa81a70ecad9facfc332d843ee37de35.tar.bz2
t7003: fix subdirectory-filter test
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>
-rwxr-xr-xt/t7003-filter-branch.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 0da13a8..fd7e3a1 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -147,7 +147,8 @@ test_expect_success 'use index-filter to move into a subdirectory' '
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) &&