diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-08-27 14:46:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-27 18:36:39 -0700 |
commit | a20efee9cfcf9c68bb01d0aa82ffc7903d88bab4 (patch) | |
tree | e329f429d9abd42f015099a072efedcfd385ec46 /submodule.c | |
parent | d0f1ea6003d97e63110fa7d50bb07f546a909b6e (diff) | |
download | git-a20efee9cfcf9c68bb01d0aa82ffc7903d88bab4.tar.gz |
in_merge_bases(): support only one "other" commit
In early days of its life, I planned to make it possible to compute
"is a commit contained in all of these other commits?" with this
function, but it turned out that no caller needed it.
Just make it take two commit objects and add a comment to say what
these two functions do.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/submodule.c b/submodule.c index 9a28060679..8fc974d1cb 100644 --- a/submodule.c +++ b/submodule.c @@ -738,7 +738,7 @@ static int find_first_merges(struct object_array *result, const char *path, die("revision walk setup failed"); while ((commit = get_revision(&revs)) != NULL) { struct object *o = &(commit->object); - if (in_merge_bases(b, &commit, 1)) + if (in_merge_bases(b, commit)) add_object_array(o, NULL, &merges); } @@ -752,7 +752,7 @@ static int find_first_merges(struct object_array *result, const char *path, contains_another = 0; for (j = 0; j < merges.nr; j++) { struct commit *m2 = (struct commit *) merges.objects[j].item; - if (i != j && in_merge_bases(m2, &m1, 1)) { + if (i != j && in_merge_bases(m2, m1)) { contains_another = 1; break; } @@ -814,18 +814,18 @@ int merge_submodule(unsigned char result[20], const char *path, } /* check whether both changes are forward */ - if (!in_merge_bases(commit_base, &commit_a, 1) || - !in_merge_bases(commit_base, &commit_b, 1)) { + if (!in_merge_bases(commit_base, commit_a) || + !in_merge_bases(commit_base, commit_b)) { MERGE_WARNING(path, "commits don't follow merge-base"); return 0; } /* Case #1: a is contained in b or vice versa */ - if (in_merge_bases(commit_a, &commit_b, 1)) { + if (in_merge_bases(commit_a, commit_b)) { hashcpy(result, b); return 1; } - if (in_merge_bases(commit_b, &commit_a, 1)) { + if (in_merge_bases(commit_b, commit_a)) { hashcpy(result, a); return 1; } |