diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-13 01:52:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-13 01:52:59 +0100 |
commit | d9cf4ec9f7ddcc589351e1ac7b0e3b88537a0b25 (patch) | |
tree | 09a47b9a6919c46c00b103f2485b711247e1f11e | |
parent | Merge branch 'jk/svn-color' (diff) | |
parent | Support a merge with conflicting gitlink change (diff) | |
download | git-d9cf4ec9f7ddcc589351e1ac7b0e3b88537a0b25.tar.xz git-d9cf4ec9f7ddcc589351e1ac7b0e3b88537a0b25.zip |
Merge branch 'jc/merge-recursive-gitlink'
* jc/merge-recursive-gitlink:
Support a merge with conflicting gitlink change
-rwxr-xr-x | git-merge-one-file.sh | 4 | ||||
-rw-r--r-- | merge-recursive.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index 1e7727d276..9ee3f80452 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -80,6 +80,10 @@ case "${1:-.}${2:-.}${3:-.}" in echo "ERROR: $4: Not merging symbolic link changes." exit 1 ;; + *,160000,*) + echo "ERROR: $4: Not merging conflicting submodule changes." + exit 1 + ;; esac src2=`git-unpack-file $3` diff --git a/merge-recursive.c b/merge-recursive.c index 9a1e2f269d..2a58dad3f4 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1046,14 +1046,16 @@ static struct merge_file_info merge_file(struct diff_filespec *o, free(result_buf.ptr); result.clean = (merge_status == 0); - } else { - if (!(S_ISLNK(a->mode) || S_ISLNK(b->mode))) - die("cannot merge modes?"); - + } else if (S_ISGITLINK(a->mode)) { + result.clean = 0; + hashcpy(result.sha, a->sha1); + } else if (S_ISLNK(a->mode)) { hashcpy(result.sha, a->sha1); if (!sha_eq(a->sha1, b->sha1)) result.clean = 0; + } else { + die("unsupported object type in the tree"); } } |