1
0
mirror of https://github.com/git/git.git synced 2024-09-20 22:12:31 +02:00

builtin-diff: fix comparison between two blobs.

The code forgot that setup_revisions() leaves parsed object
names in reverse in the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-05-15 19:05:50 -07:00
parent 8701ea0f62
commit e4e23f3a1c

View File

@ -132,7 +132,9 @@ static int builtin_diff_blobs(struct rev_info *revs,
int argc, const char **argv,
struct blobinfo *blob)
{
/* Blobs */
/* Blobs: the arguments are reversed when setup_revisions()
* picked them up.
*/
unsigned mode = canon_mode(S_IFREG | 0644);
while (1 < argc) {
@ -145,8 +147,8 @@ static int builtin_diff_blobs(struct rev_info *revs,
}
stuff_change(&revs->diffopt,
mode, mode,
blob[0].sha1, blob[1].sha1,
blob[1].name, blob[1].name);
blob[1].sha1, blob[0].sha1,
blob[0].name, blob[0].name);
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
return 0;