Skip to content

Commit

Permalink
merge-recursive: do not die on a conflicting submodule
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Apr 29, 2009
1 parent d212ca1 commit 0c44c94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions t/t7405-submodule-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand Down

0 comments on commit 0c44c94

Please sign in to comment.