From: Junio C Hamano Date: Fri, 1 Apr 2011 23:23:34 +0000 (-0700) Subject: Merge branch 'jc/maint-diff-q-filter' into maint X-Git-Tag: v1.7.4.3~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bcf3d1fd9ccc04350d793c077d3c112fb26f43f0;p=git.git Merge branch 'jc/maint-diff-q-filter' into maint * jc/maint-diff-q-filter: diff --quiet: disable optimization when --diff-filter=X is used --- bcf3d1fd9ccc04350d793c077d3c112fb26f43f0 diff --cc diff-lib.c index 392ce2bef,bfa650337..f8e33256e --- a/diff-lib.c +++ b/diff-lib.c @@@ -100,10 -72,10 +100,11 @@@ int run_diff_files(struct rev_info *rev unsigned int oldmode, newmode; struct cache_entry *ce = active_cache[i]; int changed; + unsigned dirty_submodule = 0; if (DIFF_OPT_TST(&revs->diffopt, QUICK) && - DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES)) + !revs->diffopt.filter && + DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES)) break; if (!ce_path_match(ce, revs->prune_data)) diff --cc t/t4040-whitespace-status.sh index a30b03bcf,000000000..abc49348b mode 100755,000000..100755 --- a/t/t4040-whitespace-status.sh +++ b/t/t4040-whitespace-status.sh @@@ -1,63 -1,0 +1,70 @@@ +#!/bin/sh + +test_description='diff --exit-code with whitespace' +. ./test-lib.sh + +test_expect_success setup ' + mkdir a b && + echo >c && + echo >a/d && + echo >b/e && + git add . && + test_tick && + git commit -m initial && + echo " " >a/d && + test_tick && + git commit -a -m second && + echo " " >a/d && + echo " " >b/e && + git add a/d +' + +test_expect_success 'diff-tree --exit-code' ' + test_must_fail git diff --exit-code HEAD^ HEAD && + test_must_fail git diff-tree --exit-code HEAD^ HEAD +' + +test_expect_success 'diff-tree -b --exit-code' ' + git diff -b --exit-code HEAD^ HEAD && + git diff-tree -b -p --exit-code HEAD^ HEAD && + git diff-tree -b --exit-code HEAD^ HEAD +' + +test_expect_success 'diff-index --cached --exit-code' ' + test_must_fail git diff --cached --exit-code HEAD && + test_must_fail git diff-index --cached --exit-code HEAD +' + +test_expect_success 'diff-index -b -p --cached --exit-code' ' + git diff -b --cached --exit-code HEAD && + git diff-index -b -p --cached --exit-code HEAD +' + +test_expect_success 'diff-index --exit-code' ' + test_must_fail git diff --exit-code HEAD && + test_must_fail git diff-index --exit-code HEAD +' + +test_expect_success 'diff-index -b -p --exit-code' ' + git diff -b --exit-code HEAD && + git diff-index -b -p --exit-code HEAD +' + +test_expect_success 'diff-files --exit-code' ' + test_must_fail git diff --exit-code && + test_must_fail git diff-files --exit-code +' + +test_expect_success 'diff-files -b -p --exit-code' ' + git diff -b --exit-code && + git diff-files -b -p --exit-code +' + ++test_expect_success 'diff-files --diff-filter --quiet' ' ++ git reset --hard && ++ rm a/d && ++ echo x >>b/e && ++ test_must_fail git diff-files --diff-filter=M --quiet ++' ++ +test_done