diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-02-28 09:44:16 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-29 08:06:01 -0800 |
commit | 531738052158fd66bc9b65534309f5c0a9d2808d (patch) | |
tree | 6ee90ae876a6b7523575d46931df66295ffb2cc3 /commit.c | |
parent | f87056ce403b5572683a45efe0e9021777831894 (diff) | |
download | git-531738052158fd66bc9b65534309f5c0a9d2808d.tar.gz |
commit-reach(repo_get_merge_bases_many): pass on "missing commits" errors
The `merge_bases_many()` function was just taught to indicate parsing
errors, and now the `repo_get_merge_bases_many()` function is aware of
that, too.
Naturally, there are a lot of callers that need to be adjusted now, too.
Next stop: `repo_get_merge_bases_dirty()`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1052,7 +1052,7 @@ struct commit *get_fork_point(const char *refname, struct commit *commit) { struct object_id oid; struct rev_collect revs; - struct commit_list *bases; + struct commit_list *bases = NULL; int i; struct commit *ret = NULL; char *full_refname; @@ -1077,8 +1077,9 @@ struct commit *get_fork_point(const char *refname, struct commit *commit) for (i = 0; i < revs.nr; i++) revs.commit[i]->object.flags &= ~TMP_MARK; - bases = repo_get_merge_bases_many(the_repository, commit, revs.nr, - revs.commit); + if (repo_get_merge_bases_many(the_repository, commit, revs.nr, + revs.commit, &bases) < 0) + exit(128); /* * There should be one and only one merge base, when we found |