summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 591aa25)
raw | patch | inline | side by side (parent: 591aa25)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 10 Dec 2007 19:22:05 +0000 (11:22 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Dec 2007 08:40:56 +0000 (00:40 -0800) |
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>
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>
git-merge-one-file.sh | patch | blob | history | |
merge-recursive.c | patch | blob | history |
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 1e7727d2763e744b94f55c2056eccaab12367c9e..9ee3f804520eadb322de3d0ea70a2bf9f092b089 100755 (executable)
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
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 9a1e2f269dc5eff3b7544507a1e483948cc1254d..2a58dad3f43590008045282614fb0f174f3733e5 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
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");
}
}