diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:41:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:41:49 -0700 |
commit | c0599f6993413360d8e35679a6b421d4eb16a698 (patch) | |
tree | 3d24df21194b3b9ce8f9238a424415f5c9ef2cfe /merge-recursive.c | |
parent | a2caeb2e26d57fdbbc35314d2f6ea2b872dbf54e (diff) | |
parent | 4f7cb99ada26be5d86402a6e060f3ee16a672f16 (diff) | |
download | git-c0599f6993413360d8e35679a6b421d4eb16a698.tar.gz |
Merge branch 'jk/diff-no-rename-empty'
Forbids rename detection logic from matching two empty files as renames
during merge-recursive to prevent 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 'merge-recursive.c')
-rw-r--r-- | merge-recursive.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index 857f03dc61..680937c39e 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -485,6 +485,7 @@ static struct string_list *get_renames(struct merge_options *o, renames = xcalloc(1, sizeof(struct string_list)); diff_setup(&opts); DIFF_OPT_SET(&opts, RECURSIVE); + DIFF_OPT_CLR(&opts, RENAME_EMPTY); opts.detect_rename = DIFF_DETECT_RENAME; opts.rename_limit = o->merge_rename_limit >= 0 ? o->merge_rename_limit : o->diff_rename_limit >= 0 ? o->diff_rename_limit : @@ -1914,7 +1915,7 @@ int merge_recursive(struct merge_options *o, /* if there is no common ancestor, use an empty tree */ struct tree *tree; - tree = lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN); + tree = lookup_tree(EMPTY_TREE_SHA1_BIN); merged_common_ancestors = make_virtual_commit(tree, "ancestor"); } |