merge-recursive: do not die on a conflicting submodule
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>
Junio C Hamano committed
Apr 29, 2009 at 11:08 UTC
0c44c94309693d0582e91a6744edc2e8eba46ef8
2 files changed
+9
-5
merge-recursive.c
+6
-2
@@ -520,8 +520,12 @@ static void update_file_flags(struct merge_options *o,
520
unsigned long size;
521
522
if (S_ISGITLINK(mode))
523
- die("cannot read object %s '%s': It is a submodule!",
524
- sha1_to_hex(sha), path);
523
+ /*
524
+ * We may later decide to recursively descend into
525
+ * the submodule directory and update its index
526
+ * and/or work tree, but we do not do that now.
527
+ */
528
+ goto update_index;
529
530
buf = read_sha1_file(sha, &type, &size);
531
if (!buf)
t/t7405-submodule-merge.sh
+3
-3
@@ -54,13 +54,13 @@ test_expect_success setup '
54
git merge -s ours a
55
'
56
57
-test_expect_failure 'merging with modify/modify conflict' '
57
+test_expect_success 'merging with modify/modify conflict' '
58
59
git checkout -b test1 a &&
60
test_must_fail git merge b &&
61
test -f .git/MERGE_MSG &&
62
- git diff
63
-
62
+ git diff &&
63
+ test -n "$(git ls-files -u)"
64
'
65
66
test_expect_success 'merging with a modify/modify conflict between merge bases' '