Skip to content

Commit

Permalink
builtin-diff: fix comparison between two blobs.
Browse files Browse the repository at this point in the history
The code forgot that setup_revisions() leaves parsed object
names in reverse in the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed May 16, 2006
1 parent 8701ea0 commit e4e23f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit e4e23f3

Please sign in to comment.