@matheusbsbs / matheus-bagliano / commits / f82cd3c610
Fork 0

Fix "git diff blob1 blob2" showing the diff in reverse.

This was introduced by mistake when revision.c::add_pending_object() was modified to use object-array instead of object-list. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Aug 3, 2006 at 11:50 UTC f82cd3c6104733e2ff3305c325a440731aa1d17c
1 file changed +1 -4
builtin-diff.c
+1 -4
@@ -125,9 +125,6 @@ static int builtin_diff_blobs(struct rev_info *revs,
125 int argc, const char **argv,
126 struct blobinfo *blob)
127 {
128 - /* Blobs: the arguments are reversed when setup_revisions()
129 - * picked them up.
130 - */
128 unsigned mode = canon_mode(S_IFREG | 0644);
129
130 if (argc > 1)
@@ -135,7 +132,7 @@ static int builtin_diff_blobs(struct rev_info *revs,
132
133 stuff_change(&revs->diffopt,
134 mode, mode,
138 - blob[1].sha1, blob[0].sha1,
135 + blob[0].sha1, blob[1].sha1,
136 blob[0].name, blob[0].name);
137 diffcore_std(&revs->diffopt);
138 diff_flush(&revs->diffopt);