Skip to content

Commit 0eb6574

Browse files
Clemens Buchachergitster
authored andcommitted
update cache for conflicting submodule entries
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f37ae35 commit 0eb6574

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

merge-recursive.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,11 @@ static int process_entry(struct merge_options *o,
11231123
clean_merge = mfi.clean;
11241124
if (mfi.clean)
11251125
update_file(o, 1, mfi.sha, mfi.mode, path);
1126-
else if (S_ISGITLINK(mfi.mode))
1126+
else if (S_ISGITLINK(mfi.mode)) {
11271127
output(o, 1, "CONFLICT (submodule): Merge conflict in %s "
11281128
"- needs %s", path, sha1_to_hex(b.sha1));
1129-
else {
1129+
update_file(o, 0, mfi.sha, mfi.mode, path);
1130+
} else {
11301131
output(o, 1, "CONFLICT (%s): Merge conflict in %s",
11311132
reason, path);
11321133

t/t7405-submodule-merge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test_expect_failure 'merging with modify/modify conflict' '
6363
6464
'
6565

66-
test_expect_failure 'merging with a modify/modify conflict between merge bases' '
66+
test_expect_success 'merging with a modify/modify conflict between merge bases' '
6767
6868
git reset --hard HEAD &&
6969
git checkout -b test2 c &&

0 commit comments

Comments
 (0)