summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-11 11:35:26 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-11 11:36:05 -0700
commit34f5130af84f7a37fba327d5a5be4f4427dc6886 (patch)
tree1f8836fe7fb70566e31b3f4f5d1475fabd95981b /http-push.c
parent0083f1d43a7280aefa23656eaac7266139484b24 (diff)
parentf37d3c755209234acfc2ca280027ebdab8e9ea8a (diff)
downloadgit-34f5130af84f7a37fba327d5a5be4f4427dc6886.tar.gz
Merge branch 'jc/merge-bases'
Optimise the "merge-base" computation a bit, and also update its users that do not need the full merge-base information to call a cheaper subset. * jc/merge-bases: reduce_heads(): reimplement on top of remove_redundant() merge-base: "--is-ancestor A B" get_merge_bases_many(): walk from many tips in parallel in_merge_bases(): use paint_down_to_common() merge_bases_many(): split out the logic to paint history in_merge_bases(): omit unnecessary redundant common ancestor reduction http-push: use in_merge_bases() for fast-forward check receive-pack: use in_merge_bases() for fast-forward check in_merge_bases(): support only one "other" commit
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/http-push.c b/http-push.c
index a832ca77a3..8701c1215d 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)