diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-26 21:35:33 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-26 21:35:33 +0400 |
commit | 3f231e235fb4b9c4d937a50fa4fbf35f9ed10387 (patch) | |
tree | 6f064ed970aa6363222824e2899681c383544c2d /diff.c | |
parent | 10a20b43c3d03ea1fab9095f96eda66086d3dcd2 (diff) | |
parent | 4f7cb99ada26be5d86402a6e060f3ee16a672f16 (diff) |
Merge branch 'jk/diff-no-rename-empty' into maint
Rename detection logic used to match two empty files as renames during
merge-recursive, leading unnatural mismerges.
By Jeff King
* jk/diff-no-rename-empty:
merge-recursive: don't detect renames of empty files
teach diffcore-rename to optionally ignore empty content
make is_empty_blob_sha1 available everywhere
drop casts from users EMPTY_TREE_SHA1_BIN
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3146,6 +3146,7 @@ void diff_setup(struct diff_options *options) options->rename_limit = -1; options->dirstat_permille = diff_dirstat_permille_default; options->context = 3; + DIFF_OPT_SET(options, RENAME_EMPTY); options->change = diff_change; options->add_remove = diff_addremove; @@ -3516,6 +3517,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) } else if (!strcmp(arg, "--no-renames")) options->detect_rename = 0; + else if (!strcmp(arg, "--rename-empty")) + DIFF_OPT_SET(options, RENAME_EMPTY); + else if (!strcmp(arg, "--no-rename-empty")) + DIFF_OPT_CLR(options, RENAME_EMPTY); else if (!strcmp(arg, "--relative")) DIFF_OPT_SET(options, RELATIVE_NAME); else if (!prefixcmp(arg, "--relative=")) { |