summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-10-08 11:42:15 -0700
committerJunio C Hamano <gitster@pobox.com>2012-10-08 11:42:15 -0700
commit683a820d511b3a05ea997fb4a83e78d65b623293 (patch)
treec2a65f1f0e8ddb72578cd3d05220a4c4999bfde7 /commit.c
parent5a333adeb57e5fdf66d144911d8930e702210706 (diff)
parentd866924a080215dd276c510abf255a8929b55643 (diff)
downloadgit-683a820d511b3a05ea997fb4a83e78d65b623293.tar.gz
Merge branch 'jc/merge-bases-paint-fix'
"git fmt-merge-msg" (an internal helper reduce_heads() it uses) had a severe performance regression; an empty "git pull" took forever to finish as the result. * jc/merge-bases-paint-fix: paint_down_to_common(): parse commit before relying on its timestamp
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index 02467676a3..213bc98c18 100644
--- a/commit.c
+++ b/commit.c
@@ -609,6 +609,7 @@ static struct commit *interesting(struct commit_list *list)
return NULL;
}
+/* all input commits in one and twos[] must have been parsed! */
static struct commit_list *paint_down_to_common(struct commit *one, int n, struct commit **twos)
{
struct commit_list *list = NULL;
@@ -617,6 +618,8 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc
one->object.flags |= PARENT1;
commit_list_insert_by_date(one, &list);
+ if (!n)
+ return list;
for (i = 0; i < n; i++) {
twos[i]->object.flags |= PARENT2;
commit_list_insert_by_date(twos[i], &list);
@@ -737,6 +740,8 @@ static int remove_redundant(struct commit **array, int cnt)
redundant = xcalloc(cnt, 1);
filled_index = xmalloc(sizeof(*filled_index) * (cnt - 1));
+ for (i = 0; i < cnt; i++)
+ parse_commit(array[i]);
for (i = 0; i < cnt; i++) {
struct commit_list *common;