diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-01-07 12:55:05 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-01-07 12:55:05 -0800 |
commit | 098501527f2b5628f086d3d9d2fda87220c069a5 (patch) | |
tree | d5874ea1c3185a6baa71719ff20e89ad57e53b46 /builtin | |
parent | Merge branch 'jc/strbuf-add-lines-avoid-sp-ht-sequence' (diff) | |
parent | get_merge_bases(): always clean-up object flags (diff) | |
download | tgif-098501527f2b5628f086d3d9d2fda87220c069a5.tar.xz |
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 'builtin')
-rw-r--r-- | builtin/merge-base.c | 4 | ||||
-rw-r--r-- | builtin/merge.c | 4 | ||||
-rw-r--r-- | builtin/rev-parse.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/builtin/merge-base.c b/builtin/merge-base.c index 0ecde8da30..fdebef6fa1 100644 --- a/builtin/merge-base.c +++ b/builtin/merge-base.c @@ -10,7 +10,7 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all) { struct commit_list *result; - result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 0); + result = get_merge_bases_many_dirty(rev[0], rev_nr - 1, rev + 1); if (!result) return 1; @@ -176,7 +176,7 @@ static int handle_fork_point(int argc, const char **argv) for (i = 0; i < revs.nr; i++) revs.commit[i]->object.flags &= ~TMP_MARK; - bases = get_merge_bases_many(derived, revs.nr, revs.commit, 0); + bases = get_merge_bases_many_dirty(derived, revs.nr, revs.commit); /* * There should be one and only one merge base, when we found diff --git a/builtin/merge.c b/builtin/merge.c index 215d4856e5..9effed7ff1 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1312,7 +1312,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) if (!remoteheads) ; /* already up-to-date */ else if (!remoteheads->next) - common = get_merge_bases(head_commit, remoteheads->item, 1); + common = get_merge_bases(head_commit, remoteheads->item); else { struct commit_list *list = remoteheads; commit_list_insert(head_commit, &list); @@ -1409,7 +1409,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) * merge_bases again, otherwise "git merge HEAD^ * HEAD^^" would be missed. */ - common_one = get_merge_bases(head_commit, j->item, 1); + common_one = get_merge_bases(head_commit, j->item); if (hashcmp(common_one->item->object.sha1, j->item->object.sha1)) { up_to_date = 0; diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 35d3c43ed6..95328b80d9 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -279,7 +279,7 @@ static int try_difference(const char *arg) struct commit *a, *b; a = lookup_commit_reference(sha1); b = lookup_commit_reference(end); - exclude = get_merge_bases(a, b, 1); + exclude = get_merge_bases(a, b); while (exclude) { struct commit_list *n = exclude->next; show_rev(REVERSED, |