Skip to content

Commit 565577e

Browse files
newrengitster
authored andcommitted
merge-ort: provide helpful submodule update message when possible
In commit 4057523 ("submodule merge: update conflict error message", 2022-08-04), a more detailed message was provided when submodules conflict, in order to help users know how to resolve those conflicts. There were a couple situations for which a different message would be more appropriate, but that commit left handling those for future work. Unfortunately, that commit would check if any submodules were of the type that it didn't know how to explain, and, if so, would avoid providing the more detailed explanation even for the submodules it did know how to explain. Change this to have the code print the helpful messages for the subset of submodules it knows how to explain. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34ce504 commit 565577e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

merge-ort.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4490,21 +4490,17 @@ static void print_submodule_conflict_suggestion(struct string_list *csub) {
44904490
if (!csub->nr)
44914491
return;
44924492

4493-
/*
4494-
* NEEDSWORK: The steps to resolve these errors deserve a more
4495-
* detailed explanation than what is currently printed below.
4496-
*/
4493+
strbuf_add_separated_string_list(&subs, " ", csub);
44974494
for_each_string_list_item(item, csub) {
44984495
struct conflicted_submodule_item *util = item->util;
44994496

4497+
/*
4498+
* NEEDSWORK: The steps to resolve these errors deserve a more
4499+
* detailed explanation than what is currently printed below.
4500+
*/
45004501
if (util->flag == CONFLICT_SUBMODULE_NOT_INITIALIZED ||
4501-
util->flag == CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE)
4502-
return;
4503-
}
4504-
4505-
strbuf_add_separated_string_list(&subs, " ", csub);
4506-
for_each_string_list_item(item, csub) {
4507-
struct conflicted_submodule_item *util = item->util;
4502+
util->flag == CONFLICT_SUBMODULE_HISTORY_NOT_AVAILABLE)
4503+
continue;
45084504

45094505
/*
45104506
* TRANSLATORS: This is a line of advice to resolve a merge

0 commit comments

Comments
 (0)