From b75271d93a9e4be960d53fc4f955802530e0e733 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Fri, 10 Oct 2008 21:56:15 -0400 Subject: "git diff {3,}": do not reverse order of arguments According to the message of commit 0fe7c1de16f71312e6adac4b85bddf0d62a47168, "git diff" with three or more trees expects the merged tree first followed by the parents, in order. However, this command reversed the order of its arguments, resulting in confusing diffs. A comment /* Again, the revs are all reverse */ suggested there was a reason for this, but I can't figure out the reason, so I removed the reversal of the arguments. Test case included. Signed-off-by: Matt McCutchen Signed-off-by: Shawn O. Pearce --- builtin-diff.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'builtin-diff.c') diff --git a/builtin-diff.c b/builtin-diff.c index 35da366f46..9c8c295732 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -177,10 +177,8 @@ static int builtin_diff_combined(struct rev_info *revs, if (!revs->dense_combined_merges && !revs->combine_merges) revs->dense_combined_merges = revs->combine_merges = 1; parent = xmalloc(ents * sizeof(*parent)); - /* Again, the revs are all reverse */ for (i = 0; i < ents; i++) - hashcpy((unsigned char *)(parent + i), - ent[ents - 1 - i].item->sha1); + hashcpy((unsigned char *)(parent + i), ent[i].item->sha1); diff_tree_combined(parent[0], parent + 1, ents - 1, revs->dense_combined_merges, revs); return 0; -- cgit v1.2.3