Code

merge-recursive: do not die on a conflicting submodule
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Apr 2009 18:08:18 +0000 (11:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Apr 2009 23:50:21 +0000 (16:50 -0700)
We cannot represent the 3-way conflicted state in the work tree
for these entries, but it is normal not to have commit objects
for them in our repository.  Just update the index and the life
will be good.

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

index d6f0582238cac037a9779c905b7ece55b9d21ac1..a3721efcaf9458e5c735b45794d60bac670366d2 100644 (file)
@@ -520,8 +520,12 @@ static void update_file_flags(struct merge_options *o,
                unsigned long size;
 
                if (S_ISGITLINK(mode))
-                       die("cannot read object %s '%s': It is a submodule!",
-                           sha1_to_hex(sha), path);
+                       /*
+                        * We may later decide to recursively descend into
+                        * the submodule directory and update its index
+                        * and/or work tree, but we do not do that now.
+                        */
+                       goto update_index;
 
                buf = read_sha1_file(sha, &type, &size);
                if (!buf)
index aa6c44ce4f5855bd4f18f737c7b1239407549eab..9a21f783d3a5fedaa56df26919ab8e0456872e90 100755 (executable)
@@ -54,13 +54,13 @@ test_expect_success setup '
        git merge -s ours a
 '
 
-test_expect_failure 'merging with modify/modify conflict' '
+test_expect_success 'merging with modify/modify conflict' '
 
        git checkout -b test1 a &&
        test_must_fail git merge b &&
        test -f .git/MERGE_MSG &&
-       git diff
-
+       git diff &&
+       test -n "$(git ls-files -u)"
 '
 
 test_expect_success 'merging with a modify/modify conflict between merge bases' '