@matheusbsbs / matheus-bagliano / commits / 75b62b489a
Fork 0

git-diff: fix combined diff

The code forgets that typecast binds tighter than addition, in other words: (cast *)array + i === ((cast *)array) + i Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Feb 23, 2007 at 05:20 UTC 75b62b489af7b62a5518c3f199d2a2776205e088
1 file changed +2 -1
builtin-diff.c
+2 -1
@@ -192,7 +192,8 @@ static int builtin_diff_combined(struct rev_info *revs,
192 parent = xmalloc(ents * sizeof(*parent));
193 /* Again, the revs are all reverse */
194 for (i = 0; i < ents; i++)
195 - hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1);
195 + hashcpy((unsigned char *)(parent + i),
196 + ent[ents - 1 - i].item->sha1);
197 diff_tree_combined(parent[0], parent + 1, ents - 1,
198 revs->dense_combined_merges, revs);
199 return 0;