diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-01-23 22:16:37 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-23 22:16:37 +0100 |
commit | 14b9d9aa0d2fc6fd81d7a392fc1cc951a9d9d115 (patch) | |
tree | 1ca0e09bdde1dc240bb9051cccf1ae45c3cd6570 /merge-recursive.c | |
parent | Merge branch 'rs/lose-leak-pending' (diff) | |
parent | merge: teach -Xours/-Xtheirs to symbolic link merge (diff) | |
download | git-14b9d9aa0d2fc6fd81d7a392fc1cc951a9d9d115.tar.xz git-14b9d9aa0d2fc6fd81d7a392fc1cc951a9d9d115.zip |
Merge branch 'jc/merge-symlink-ours-theirs'
"git merge -Xours/-Xtheirs" learned to use our/their version when
resolving a conflicting updates to a symbolic link.
* jc/merge-symlink-ours-theirs:
merge: teach -Xours/-Xtheirs to symbolic link merge
Diffstat (limited to 'merge-recursive.c')
-rw-r--r-- | merge-recursive.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index 0fc580d8ca..cc5fa0a949 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1026,10 +1026,19 @@ static int merge_file_1(struct merge_options *o, &b->oid, !o->call_depth); } else if (S_ISLNK(a->mode)) { - oidcpy(&result->oid, &a->oid); - - if (!oid_eq(&a->oid, &b->oid)) - result->clean = 0; + switch (o->recursive_variant) { + case MERGE_RECURSIVE_NORMAL: + oidcpy(&result->oid, &a->oid); + if (!oid_eq(&a->oid, &b->oid)) + result->clean = 0; + break; + case MERGE_RECURSIVE_OURS: + oidcpy(&result->oid, &a->oid); + break; + case MERGE_RECURSIVE_THEIRS: + oidcpy(&result->oid, &b->oid); + break; + } } else die("BUG: unsupported object type in the tree"); } |