From c1ea625f72110fda87fd225d7dff002befb82d9f Mon Sep 17 00:00:00 2001 From: Carlo Marcelo Arenas Belón Date: Tue, 23 Jun 2020 11:42:22 -0700 Subject: commit-reach: avoid is_descendant_of() shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit d91d6fbf26 (commit-reach: create repo_is_descendant_of(), 2020-06-17) adds a repository aware version of is_descendant_of() and a backward compatibility shim that is barely used. Update all callers to directly use the new repo_is_descendant_of() function instead; making the codebase simpler and pushing more the_repository references higher up the stack. Helped-by: Derrick Stolee Signed-off-by: Carlo Marcelo Arenas Belón Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- builtin/pull.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'builtin/pull.c') diff --git a/builtin/pull.c b/builtin/pull.c index 00e5857a8d..fe5f33557f 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -1025,7 +1025,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix) commit_list_insert(head, &list); merge_head = lookup_commit_reference(the_repository, &merge_heads.oid[0]); - if (is_descendant_of(merge_head, list)) { + if (repo_is_descendant_of(the_repository, + merge_head, list)) { /* we can fast-forward this without invoking rebase */ opt_ff = "--ff-only"; ran_ff = 1; -- cgit 1.2.3-korg