diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-02-28 09:44:17 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-29 08:06:01 -0800 |
commit | caaf1a2942c25c1f1a15818b718c9f641e52beef (patch) | |
tree | 89081fd5a84761adaddb19afb1ed5395411d95f2 /builtin | |
parent | 531738052158fd66bc9b65534309f5c0a9d2808d (diff) | |
download | git-caaf1a2942c25c1f1a15818b718c9f641e52beef.tar.gz |
commit-reach(repo_get_merge_bases_many_dirty): pass on errors
(Actually, this commit is only about passing on "missing commits"
errors, but adding that to the commit's title would have made it too
long.)
The `merge_bases_many()` function was just taught to indicate parsing
errors, and now the `repo_get_merge_bases_many_dirty()` function is
aware of that, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/merge-base.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/merge-base.c b/builtin/merge-base.c index 4d1ff840bd..5a8e729502 100644 --- a/builtin/merge-base.c +++ b/builtin/merge-base.c @@ -10,10 +10,13 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all) { - struct commit_list *result, *r; + struct commit_list *result = NULL, *r; - result = repo_get_merge_bases_many_dirty(the_repository, rev[0], - rev_nr - 1, rev + 1); + if (repo_get_merge_bases_many_dirty(the_repository, rev[0], + rev_nr - 1, rev + 1, &result) < 0) { + free_commit_list(result); + return -1; + } if (!result) return 1; |