]> git.ipfire.org Git - thirdparty/git.git/commitdiff
update cache for conflicting submodule entries
authorClemens Buchacher <drizzd@aon.at>
Sun, 5 Apr 2009 00:46:59 +0000 (02:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 5 Apr 2009 07:26:32 +0000 (00:26 -0700)
When merging merge bases during a recursive merge we do not want to
leave any unmerged entries. Otherwise we cannot create a temporary
tree for the recursive merge to work with.

We failed to do so in case of a submodule conflict between merge
bases, causing a NULL pointer dereference in the next step of the
recursive merge.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c
t/t7405-submodule-merge.sh

index ee853b990d8bfb15e0058fefbbd267bd58ed40fc..3618c94bd2e4722bab29bff8ee7d530c430029ce 100644 (file)
@@ -1123,10 +1123,11 @@ static int process_entry(struct merge_options *o,
                clean_merge = mfi.clean;
                if (mfi.clean)
                        update_file(o, 1, mfi.sha, mfi.mode, path);
-               else if (S_ISGITLINK(mfi.mode))
+               else if (S_ISGITLINK(mfi.mode)) {
                        output(o, 1, "CONFLICT (submodule): Merge conflict in %s "
                               "- needs %s", path, sha1_to_hex(b.sha1));
-               else {
+                       update_file(o, 0, mfi.sha, mfi.mode, path);
+               } else {
                        output(o, 1, "CONFLICT (%s): Merge conflict in %s",
                                        reason, path);
 
index 9778ad49cf1c8ac344f20eb50ef0a88e2b2668aa..aa6c44ce4f5855bd4f18f737c7b1239407549eab 100755 (executable)
@@ -63,7 +63,7 @@ test_expect_failure 'merging with modify/modify conflict' '
 
 '
 
-test_expect_failure 'merging with a modify/modify conflict between merge bases' '
+test_expect_success 'merging with a modify/modify conflict between merge bases' '
 
        git reset --hard HEAD &&
        git checkout -b test2 c &&