diff options
| author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2025-02-18 16:24:36 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-18 09:52:39 -0800 |
| commit | 1b0e5f4499a0c099d99b00a2a6a3edb45ae98660 (patch) | |
| tree | 4cfd8c00e15ff1028ea4ac8593afb5ffa3f9cafa /builtin/merge-tree.c | |
| parent | 344a107b557604d3f958e7bf7ebf0901290c50d5 (diff) | |
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. The return value of real_merge() is
ignored because exit status of "git merge-tree --stdin" is "0" for both
successful and conflicted merges (the status of each merge is written to
stdout). The return type of real_merge() is not changed as it is used
for the program's exit status when "--stdin" is not given.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-tree.c')
| -rw-r--r-- | builtin/merge-tree.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index 57f4340fab..3c73482f2b 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -601,7 +601,6 @@ int cmd_merge_tree(int argc, line_termination = '\0'; while (strbuf_getline_lf(&buf, stdin) != EOF) { struct strbuf **split; - int result; const char *input_merge_base = NULL; split = strbuf_split(&buf, ' '); @@ -618,16 +617,14 @@ int cmd_merge_tree(int argc, if (input_merge_base && split[2] && split[3] && !split[4]) { strbuf_rtrim(split[2]); strbuf_rtrim(split[3]); - result = real_merge(&o, input_merge_base, split[2]->buf, split[3]->buf, prefix); + real_merge(&o, input_merge_base, split[2]->buf, split[3]->buf, prefix); } else if (!input_merge_base && !split[2]) { - result = real_merge(&o, NULL, split[0]->buf, split[1]->buf, prefix); + real_merge(&o, NULL, split[0]->buf, split[1]->buf, prefix); } else { die(_("malformed input line: '%s'."), buf.buf); } maybe_flush_or_die(stdout, "stdout"); - if (result < 0) - die(_("merging cannot continue; got unclean result of %d"), result); strbuf_list_free(split); } strbuf_release(&buf); |
