summaryrefslogtreecommitdiffstats
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-11 22:12:30 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-11 22:12:30 +0100
commit7745f92507517c4e60dc2a7faad40eee49ee670b (patch)
treef9eb30d1767f40a69db6b874f50bbdc8953d745d /builtin/rebase.c
parentThe fifth batch (diff)
parentmerge-ort/merge-recursive: do report errors in `merge_submodule()` (diff)
downloadgit-7745f92507517c4e60dc2a7faad40eee49ee670b.tar.xz
git-7745f92507517c4e60dc2a7faad40eee49ee670b.zip
Merge branch 'js/merge-base-with-missing-commit'
Make sure failure return from merge_bases_many() is properly caught. * js/merge-base-with-missing-commit: merge-ort/merge-recursive: do report errors in `merge_submodule()` merge-recursive: prepare for `merge_submodule()` to report errors commit-reach(repo_get_merge_bases_many_dirty): pass on errors commit-reach(repo_get_merge_bases_many): pass on "missing commits" errors commit-reach(get_octopus_merge_bases): pass on "missing commits" errors commit-reach(repo_get_merge_bases): pass on "missing commits" errors commit-reach(get_merge_bases_many_0): pass on "missing commits" errors commit-reach(merge_bases_many): pass on "missing commits" errors commit-reach(paint_down_to_common): start reporting errors commit-reach(paint_down_to_common): prepare for handling shallow commits commit-reach(repo_in_merge_bases_many): report missing commits commit-reach(repo_in_merge_bases_many): optionally expect missing commits commit-reach(paint_down_to_common): plug two memory leaks
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 6ead9465a4..be787690bd 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -867,7 +867,8 @@ static int can_fast_forward(struct commit *onto, struct commit *upstream,
if (!upstream)
goto done;
- merge_bases = repo_get_merge_bases(the_repository, upstream, head);
+ if (repo_get_merge_bases(the_repository, upstream, head, &merge_bases) < 0)
+ exit(128);
if (!merge_bases || merge_bases->next)
goto done;
@@ -886,8 +887,9 @@ static void fill_branch_base(struct rebase_options *options,
{
struct commit_list *merge_bases = NULL;
- merge_bases = repo_get_merge_bases(the_repository, options->onto,
- options->orig_head);
+ if (repo_get_merge_bases(the_repository, options->onto,
+ options->orig_head, &merge_bases) < 0)
+ exit(128);
if (!merge_bases || merge_bases->next)
oidcpy(branch_base, null_oid());
else