Skip to content

Commit 39d8e27

Browse files
Clemens Buchachergitster
authored andcommitted
simplify output of conflicting merge
This simplifies the code without changing the semantics and removes the unhelpful "needs $sha1" part of the conflicting submodule message. Signed-off-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0eb6574 commit 39d8e27

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

merge-recursive.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,22 +1121,13 @@ static int process_entry(struct merge_options *o,
11211121
o->branch1, o->branch2);
11221122

11231123
clean_merge = mfi.clean;
1124-
if (mfi.clean)
1125-
update_file(o, 1, mfi.sha, mfi.mode, path);
1126-
else if (S_ISGITLINK(mfi.mode)) {
1127-
output(o, 1, "CONFLICT (submodule): Merge conflict in %s "
1128-
"- needs %s", path, sha1_to_hex(b.sha1));
1129-
update_file(o, 0, mfi.sha, mfi.mode, path);
1130-
} else {
1124+
if (!mfi.clean) {
1125+
if (S_ISGITLINK(mfi.mode))
1126+
reason = "submodule";
11311127
output(o, 1, "CONFLICT (%s): Merge conflict in %s",
11321128
reason, path);
1133-
1134-
if (o->call_depth)
1135-
update_file(o, 0, mfi.sha, mfi.mode, path);
1136-
else
1137-
update_file_flags(o, mfi.sha, mfi.mode, path,
1138-
0 /* update_cache */, 1 /* update_working_directory */);
11391129
}
1130+
update_file(o, mfi.clean, mfi.sha, mfi.mode, path);
11401131
} else if (!o_sha && !a_sha && !b_sha) {
11411132
/*
11421133
* this entry was deleted altogether. a_mode == 0 means

0 commit comments

Comments
 (0)