Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin-diff: fix comparison between two blobs.
author
Junio C Hamano
<junkio@cox.net>
Tue, 16 May 2006 02:05:50 +0000
(19:05 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 16 May 2006 02:05:50 +0000
(19:05 -0700)
The code forgot that setup_revisions() leaves parsed object
names in reverse in the list.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8701ea0
)
diff --git
a/builtin-diff.c
b/builtin-diff.c
index d3ac581f291dae630478248133344e2dd6a80b06..b0c9cade02fef6d71bf45dd2fceb6d573778195e 100644
(file)
--- 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)
{
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) {
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,
}
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;
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
return 0;