From 2ce406ccb85c4546b6d19309a6101b37c7bd952e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 30 Oct 2014 12:20:44 -0700 Subject: get_merge_bases(): always clean-up object flags The callers of get_merge_bases() can choose to leave object flags used during the merge-base traversal by passing cleanup=0 as a parameter, but in practice a very few callers can afford to do so (namely, "git merge-base"), as they need to compute merge base in preparation for other processing of their own and they need to see the object without contaminate flags. Change the function signature of get_merge_bases_many() and get_merge_bases() to drop the cleanup parameter, so that the majority of the callers do not have to say ", 1" at the end. Give a new get_merge_bases_many_dirty() API to support only a few callers that know they do not need to spend cycles cleaning up the object flags. Signed-off-by: Junio C Hamano --- commit.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'commit.h') diff --git a/commit.h b/commit.h index 2e1492a6e4..7cd4503581 100644 --- a/commit.h +++ b/commit.h @@ -223,10 +223,13 @@ struct commit_graft *read_graft_line(char *buf, int len); int register_commit_graft(struct commit_graft *, int); struct commit_graft *lookup_commit_graft(const unsigned char *sha1); -extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup); -extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup); +extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2); +extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos); extern struct commit_list *get_octopus_merge_bases(struct commit_list *in); +/* To be used only when object flags after this call no longer matter */ +extern struct commit_list *get_merge_bases_many_dirty(struct commit *one, int n, struct commit **twos); + /* largest positive number a signed 32-bit integer can contain */ #define INFINITE_DEPTH 0x7fffffff -- cgit v1.2.3