mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'rs/diff-quiet-no-rename'
As "git diff --quiet" only cares about the existence of any changes, disable rename/copy detection to skip more expensive processing whose result will be discarded anyway. * rs/diff-quiet-no-rename: diff: disable rename detection with --quiet
This commit is contained in:
2
diff.c
2
diff.c
@@ -4987,6 +4987,8 @@ void diff_setup_done(struct diff_options *options)
|
|||||||
if (options->flags.quick) {
|
if (options->flags.quick) {
|
||||||
options->output_format = DIFF_FORMAT_NO_OUTPUT;
|
options->output_format = DIFF_FORMAT_NO_OUTPUT;
|
||||||
options->flags.exit_with_status = 1;
|
options->flags.exit_with_status = 1;
|
||||||
|
options->detect_rename = 0;
|
||||||
|
options->flags.find_copies_harder = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -41,6 +41,16 @@ test_expect_success 'copy detection, cached' '
|
|||||||
compare_diff_raw current expected
|
compare_diff_raw current expected
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'exit code of quiet copy detection' '
|
||||||
|
test_expect_code 1 \
|
||||||
|
git diff --quiet --cached --find-copies-harder $tree
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'exit code of quiet copy detection with --no-ext-diff' '
|
||||||
|
test_expect_code 1 \
|
||||||
|
git diff --quiet --cached --find-copies-harder --no-ext-diff $tree
|
||||||
|
'
|
||||||
|
|
||||||
# In the tree, there is only path0/COPYING. In the cache, path0 and
|
# In the tree, there is only path0/COPYING. In the cache, path0 and
|
||||||
# path1 both have COPYING and the latter is a copy of path0/COPYING.
|
# path1 both have COPYING and the latter is a copy of path0/COPYING.
|
||||||
# However when we say we care only about path1, we should just see
|
# However when we say we care only about path1, we should just see
|
||||||
|
|||||||
Reference in New Issue
Block a user