Skip to content

Commit 6571225

Browse files
committed
http-push: use in_merge_bases() for fast-forward check
The original computed merge-base between HEAD and the remote ref and checked if the remote ref is a merge base between them, in order to make sure that we are fast-forwarding. Instead, call in_merge_bases(remote, HEAD) which does the same. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5d55915 commit 6571225

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

http-push.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,9 +1610,8 @@ static int verify_merge_base(unsigned char *head_sha1, struct ref *remote)
16101610
{
16111611
struct commit *head = lookup_commit_or_die(head_sha1, "HEAD");
16121612
struct commit *branch = lookup_commit_or_die(remote->old_sha1, remote->name);
1613-
struct commit_list *merge_bases = get_merge_bases(head, branch, 1);
16141613

1615-
return (merge_bases && !merge_bases->next && merge_bases->item == branch);
1614+
return in_merge_bases(branch, head);
16161615
}
16171616

16181617
static int delete_remote_branch(const char *pattern, int force)

0 commit comments

Comments
 (0)