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 <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Clemens Buchacher committed
Apr 5, 2009 at 02:47 UTC
39d8e271f42e976a61f08a4f7bc2047a682ac532
1 file changed
+4
-13
merge-recursive.c
+4
-13
@@ -1121,22 +1121,13 @@ static int process_entry(struct merge_options *o,
1121
o->branch1, o->branch2);
1122
1123
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";
1127
output(o, 1, "CONFLICT (%s): Merge conflict in %s",
1128
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 */);
1129
}
1130
+ update_file(o, mfi.clean, mfi.sha, mfi.mode, path);
1131
} else if (!o_sha && !a_sha && !b_sha) {
1132
/*
1133
* this entry was deleted altogether. a_mode == 0 means