summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-07 12:55:05 -0800
committerJunio C Hamano <gitster@pobox.com>2015-01-07 12:55:05 -0800
commit098501527f2b5628f086d3d9d2fda87220c069a5 (patch)
treed5874ea1c3185a6baa71719ff20e89ad57e53b46 /commit.c
parent58e0362eddba1678a71c8990862053ff989527b6 (diff)
parent2ce406ccb85c4546b6d19309a6101b37c7bd952e (diff)
downloadgit-098501527f2b5628f086d3d9d2fda87220c069a5.tar.gz
Merge branch 'jc/merge-bases'
The get_merge_bases*() API was easy to misuse by careless copy&paste coders, leaving object flags tainted in the commits that needed to be traversed. * jc/merge-bases: get_merge_bases(): always clean-up object flags bisect: clean flags after checking merge bases
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/commit.c b/commit.c
index a54cb9a454..a8c7577d28 100644
--- a/commit.c
+++ b/commit.c
@@ -867,7 +867,7 @@ struct commit_list *get_octopus_merge_bases(struct commit_list *in)
for (j = ret; j; j = j->next) {
struct commit_list *bases;
- bases = get_merge_bases(i->item, j->item, 1);
+ bases = get_merge_bases(i->item, j->item);
if (!new)
new = bases;
else
@@ -936,10 +936,10 @@ static int remove_redundant(struct commit **array, int cnt)
return filled;
}
-struct commit_list *get_merge_bases_many(struct commit *one,
- int n,
- struct commit **twos,
- int cleanup)
+static struct commit_list *get_merge_bases_many_0(struct commit *one,
+ int n,
+ struct commit **twos,
+ int cleanup)
{
struct commit_list *list;
struct commit **rslt;
@@ -977,10 +977,23 @@ struct commit_list *get_merge_bases_many(struct commit *one,
return result;
}
-struct commit_list *get_merge_bases(struct commit *one, struct commit *two,
- int cleanup)
+struct commit_list *get_merge_bases_many(struct commit *one,
+ int n,
+ struct commit **twos)
+{
+ return get_merge_bases_many_0(one, n, twos, 1);
+}
+
+struct commit_list *get_merge_bases_many_dirty(struct commit *one,
+ int n,
+ struct commit **twos)
+{
+ return get_merge_bases_many_0(one, n, twos, 0);
+}
+
+struct commit_list *get_merge_bases(struct commit *one, struct commit *two)
{
- return get_merge_bases_many(one, 1, &two, cleanup);
+ return get_merge_bases_many_0(one, 1, &two, 1);
}
/*