Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-07 08:09:15 +0300
committerJunio C Hamano <gitster@pobox.com>2020-07-07 08:09:16 +0300
commit0258ed1e08e7973f1d6829db8d33109851067a91 (patch)
treec94e74d689f3b1ab05cf3a14392016795506d899 /commit-reach.c
parent5c61d10b16ad949af9adf824ae3fd4f62a5142e7 (diff)
parentc1ea625f72110fda87fd225d7dff002befb82d9f (diff)
Merge branch 'cb/is-descendant-of'
Code clean-up. * cb/is-descendant-of: commit-reach: avoid is_descendant_of() shim
Diffstat (limited to 'commit-reach.c')
-rw-r--r--commit-reach.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/commit-reach.c b/commit-reach.c
index a7a0b87263..efd5925cbb 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -286,9 +286,9 @@ struct commit_list *repo_get_merge_bases(struct repository *r,
/*
* Is "commit" a descendant of one of the elements on the "with_commit" list?
*/
-static int repo_is_descendant_of(struct repository *r,
- struct commit *commit,
- struct commit_list *with_commit)
+int repo_is_descendant_of(struct repository *r,
+ struct commit *commit,
+ struct commit_list *with_commit)
{
if (!with_commit)
return 1;
@@ -313,11 +313,6 @@ static int repo_is_descendant_of(struct repository *r,
}
}
-int is_descendant_of(struct commit *commit, struct commit_list *with_commit)
-{
- return repo_is_descendant_of(the_repository, commit, with_commit);
-}
-
/*
* Is "commit" an ancestor of one of the "references"?
*/
@@ -439,7 +434,8 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
return 0;
commit_list_insert(old_commit, &old_commit_list);
- ret = is_descendant_of(new_commit, old_commit_list);
+ ret = repo_is_descendant_of(the_repository,
+ new_commit, old_commit_list);
free_commit_list(old_commit_list);
return ret;
}
@@ -562,7 +558,7 @@ int commit_contains(struct ref_filter *filter, struct commit *commit,
{
if (filter->with_commit_tag_algo)
return contains_tag_algo(commit, list, cache) == CONTAINS_YES;
- return is_descendant_of(commit, list);
+ return repo_is_descendant_of(the_repository, commit, list);
}
static int compare_commits_by_gen(const void *_a, const void *_b)