Skip to content

Commit 5905f2d

Browse files
committed
merge-tree: remove redundant code
real_merge() only ever returns "0" or "1" as it dies if the merge status is less than zero. Therefore the check for "result < 0" is redundant and the result variable is not needed. Signed-off-by: Phillip Wood <[email protected]>
1 parent 2046cf6 commit 5905f2d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

builtin/merge-tree.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ int cmd_merge_tree(int argc,
601601
line_termination = '\0';
602602
while (strbuf_getline_lf(&buf, stdin) != EOF) {
603603
struct strbuf **split;
604-
int result;
605604
const char *input_merge_base = NULL;
606605

607606
split = strbuf_split(&buf, ' ');
@@ -618,16 +617,14 @@ int cmd_merge_tree(int argc,
618617
if (input_merge_base && split[2] && split[3] && !split[4]) {
619618
strbuf_rtrim(split[2]);
620619
strbuf_rtrim(split[3]);
621-
result = real_merge(&o, input_merge_base, split[2]->buf, split[3]->buf, prefix);
620+
real_merge(&o, input_merge_base, split[2]->buf, split[3]->buf, prefix);
622621
} else if (!input_merge_base && !split[2]) {
623-
result = real_merge(&o, NULL, split[0]->buf, split[1]->buf, prefix);
622+
real_merge(&o, NULL, split[0]->buf, split[1]->buf, prefix);
624623
} else {
625624
die(_("malformed input line: '%s'."), buf.buf);
626625
}
627626
maybe_flush_or_die(stdout, "stdout");
628627

629-
if (result < 0)
630-
die(_("merging cannot continue; got unclean result of %d"), result);
631628
strbuf_list_free(split);
632629
}
633630
strbuf_release(&buf);

0 commit comments

Comments
 (0)