Skip to content

Commit

Permalink
Merge branch 'jc/merge-recursive-gitlink'
Browse files Browse the repository at this point in the history
* jc/merge-recursive-gitlink:
  Support a merge with conflicting gitlink change
  • Loading branch information
Junio C Hamano committed Dec 13, 2007
2 parents cfa97ae + ff72af0 commit d9cf4ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions git-merge-one-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 6 additions & 4 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit d9cf4ec

Please sign in to comment.