summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-16 02:05:50 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-16 02:05:50 (GMT)
commite4e23f3a1c7734cdad60ba1274487ee6e2198de3 (patch)
tree7ba379e2a17f53434a11ad63882a4322b59f9893 /builtin-diff.c
parent8701ea0f627dcba4bb75570f87df9c93985d397a (diff)
downloadgit-e4e23f3a1c7734cdad60ba1274487ee6e2198de3.zip
git-e4e23f3a1c7734cdad60ba1274487ee6e2198de3.tar.gz
git-e4e23f3a1c7734cdad60ba1274487ee6e2198de3.tar.bz2
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>
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index d3ac581..b0c9cad 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -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;