Skip to content

Commit 11f4290

Browse files
newrengitster
authored andcommitted
merge-ort-wrappers: make printed message match the one from recursive
When the index does not match HEAD, the merge strategies are responsible to detect that condition and abort. The merge-ort-wrappers had code to implement this and meant to copy the error message from merge-recursive but deviated in two ways, both due to the message in merge-recursive being processed by another function that made additional changes: * It added an implicit "error: " prefix * It added an implicit trailing newline We can get these things by making use of the error() function. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e72d93e commit 11f4290

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

merge-ort-wrappers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ static int unclean(struct merge_options *opt, struct tree *head)
1010
struct strbuf sb = STRBUF_INIT;
1111

1212
if (head && repo_index_has_changes(opt->repo, head, &sb)) {
13-
fprintf(stderr, _("Your local changes to the following files would be overwritten by merge:\n %s"),
14-
sb.buf);
13+
error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
14+
sb.buf);
1515
strbuf_release(&sb);
1616
return -1;
1717
}

0 commit comments

Comments
 (0)