projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide a way to flush git-diff-tree's output
[git.git]
/
builtin-diff.c
diff --git
a/builtin-diff.c
b/builtin-diff.c
index
b6114ce
..
b0c9cad
100644
(file)
--- a/
builtin-diff.c
+++ b/
builtin-diff.c
@@
-84,8
+84,7
@@
static void stuff_change(struct diff_options *opt,
if (opt->reverse_diff) {
unsigned tmp;
if (opt->reverse_diff) {
unsigned tmp;
- const
- const unsigned char *tmp_u;
+ const unsigned char *tmp_u;
const char *tmp_c;
tmp = old_mode; old_mode = new_mode; new_mode = tmp;
tmp_u = old_sha1; old_sha1 = new_sha1; new_sha1 = tmp_u;
const char *tmp_c;
tmp = old_mode; old_mode = new_mode; new_mode = tmp;
tmp_u = old_sha1; old_sha1 = new_sha1; new_sha1 = tmp_u;
@@
-133,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) {
@@
-146,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;
@@
-271,7
+272,7
@@
int cmd_diff(int argc, const char **argv, char **envp)
*
* Other cases are errors.
*/
*
* Other cases are errors.
*/
-
+
git_config(git_diff_config);
init_revisions(&rev);
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
git_config(git_diff_config);
init_revisions(&rev);
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
@@
-321,7
+322,7
@@
int cmd_diff(int argc, const char **argv, char **envp)
blob[blobs].name = name;
blobs++;
continue;
blob[blobs].name = name;
blobs++;
continue;
-
+
}
die("unhandled object '%s' given.", name);
}
}
die("unhandled object '%s' given.", name);
}