aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-04 12:20:09 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-04 12:20:18 -0800
commit0421d9f812acc819dcf9e9c6707618aca7e80bf4 (patch)
tree495875a4e5b5f76c98f2ebe6de3f2e41a332e78d
parent2f3f8b218abae6fc0574d0e22d3614fc0f5e983d (diff)
downloadgit-0421d9f812acc819dcf9e9c6707618aca7e80bf4.tar.gz
git-0421d9f812acc819dcf9e9c6707618aca7e80bf4.tar.xz
git-pickaxe: simplify Octopus merges further
If more than one parents in an Octopus merge have the same origin, ignore later ones because it would not make any difference in the outcome. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--builtin-pickaxe.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/builtin-pickaxe.c b/builtin-pickaxe.c
index 97b373241..082ff45fe 100644
--- a/builtin-pickaxe.c
+++ b/builtin-pickaxe.c
@@ -915,6 +915,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
i < MAXPARENT && parent;
parent = parent->next, i++) {
struct commit *p = parent->item;
+ int j, same;
if (parent_origin[i])
continue;
@@ -934,7 +935,16 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
origin_decref(porigin);
goto finish;
}
- parent_origin[i] = porigin;
+ for (j = same = 0; j < i; j++)
+ if (!hashcmp(parent_origin[j]->blob_sha1,
+ porigin->blob_sha1)) {
+ same = 1;
+ break;
+ }
+ if (!same)
+ parent_origin[i] = porigin;
+ else
+ origin_decref(porigin);
}
}