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>
Junio C Hamano committed
Nov 4, 2006 at 12:20 UTC
0421d9f812acc819dcf9e9c6707618aca7e80bf4
1 file changed
+11
-1
builtin-pickaxe.c
+11
-1
@@ -915,6 +915,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
915
i < MAXPARENT && parent;
916
parent = parent->next, i++) {
917
struct commit *p = parent->item;
918
+ int j, same;
919
920
if (parent_origin[i])
921
continue;
@@ -934,7 +935,16 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
935
origin_decref(porigin);
936
goto finish;
937
}
937
- parent_origin[i] = porigin;
938
+ for (j = same = 0; j < i; j++)
939
+ if (!hashcmp(parent_origin[j]->blob_sha1,
940
+ porigin->blob_sha1)) {
941
+ same = 1;
942
+ break;
943
+ }
944
+ if (!same)
945
+ parent_origin[i] = porigin;
946
+ else
947
+ origin_decref(porigin);
948
}
949
}
950