mirror of
https://github.com/git/git.git
synced 2024-06-02 00:06:11 +02:00
Support a merge with conflicting gitlink change
merge-recursive did not support merging trees that have conflicting changes in submodules they contain, and died. Support it exactly the same way as how it handles conflicting symbolic link changes --- mark it as a conflict, take the tentative result from the current side, and letting the caller resolve the conflict, without dying in merge_file() function. Also reword the error message issued when merge_file() has to die because it sees a tree entry of type it does not support yet. [jc: fixed up initial draft by Finn Arne Gangstad] Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
591aa2536f
commit
ff72af00f8
|
@ -80,6 +80,10 @@ case "${1:-.}${2:-.}${3:-.}" in
|
||||||
echo "ERROR: $4: Not merging symbolic link changes."
|
echo "ERROR: $4: Not merging symbolic link changes."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
*,160000,*)
|
||||||
|
echo "ERROR: $4: Not merging conflicting submodule changes."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
src2=`git-unpack-file $3`
|
src2=`git-unpack-file $3`
|
||||||
|
|
|
@ -1046,14 +1046,16 @@ static struct merge_file_info merge_file(struct diff_filespec *o,
|
||||||
|
|
||||||
free(result_buf.ptr);
|
free(result_buf.ptr);
|
||||||
result.clean = (merge_status == 0);
|
result.clean = (merge_status == 0);
|
||||||
} else {
|
} else if (S_ISGITLINK(a->mode)) {
|
||||||
if (!(S_ISLNK(a->mode) || S_ISLNK(b->mode)))
|
result.clean = 0;
|
||||||
die("cannot merge modes?");
|
hashcpy(result.sha, a->sha1);
|
||||||
|
} else if (S_ISLNK(a->mode)) {
|
||||||
hashcpy(result.sha, a->sha1);
|
hashcpy(result.sha, a->sha1);
|
||||||
|
|
||||||
if (!sha_eq(a->sha1, b->sha1))
|
if (!sha_eq(a->sha1, b->sha1))
|
||||||
result.clean = 0;
|
result.clean = 0;
|
||||||
|
} else {
|
||||||
|
die("unsupported object type in the tree");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue