Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
http-push: use in_merge_bases() for fast-forward check
author
Junio C Hamano
<gitster@pobox.com>
Mon, 27 Aug 2012 22:21:37 +0000
(15:21 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 28 Aug 2012 01:36:39 +0000
(18:36 -0700)
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>
http-push.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
5d55915
)
diff --git
a/http-push.c
b/http-push.c
index f22f7e43caa3e804c5c8275ba0312d58611d7da3..555c056d64aa2a87f5d9ec305c43ef65bc896176 100644
(file)
--- 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)