diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-08-27 15:21:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-27 18:36:39 -0700 |
commit | 6571225137b1ba270b49a0dfc6a30aab6f4b86ba (patch) | |
tree | bfc6be12df7a548eb0bfcd334d02b32b87e59318 | |
parent | receive-pack: use in_merge_bases() for fast-forward check (diff) | |
download | tgif-6571225137b1ba270b49a0dfc6a30aab6f4b86ba.tar.xz |
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 <gitster@pobox.com>
-rw-r--r-- | http-push.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/http-push.c b/http-push.c index f22f7e43ca..555c056d64 100644 --- a/http-push.c +++ b/http-push.c @@ -1610,9 +1610,8 @@ static int verify_merge_base(unsigned char *head_sha1, struct ref *remote) { struct commit *head = lookup_commit_or_die(head_sha1, "HEAD"); struct commit *branch = lookup_commit_or_die(remote->old_sha1, remote->name); - struct commit_list *merge_bases = get_merge_bases(head, branch, 1); - return (merge_bases && !merge_bases->next && merge_bases->item == branch); + return in_merge_bases(branch, head); } static int delete_remote_branch(const char *pattern, int force) |