aboutsummaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2009-03-25 18:19:46 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-25 12:15:30 -0700
commit5d83f9c19810229bb765ef63864e4f252e83ad61 (patch)
treea742e49e7e8d90357985d921a20df3303c5eb979 /diff-no-index.c
parent2a5643da732b70004920f75efa1ebdc2a6ed1689 (diff)
downloadgit-5d83f9c19810229bb765ef63864e4f252e83ad61.tar.gz
git-5d83f9c19810229bb765ef63864e4f252e83ad61.tar.xz
diff --no-index: Do not generate patch output if other output is requested
Previously, 'git diff --no-index --stat a b' generated patch output in addition to the --stat output (or whatever other output format was requested). Now only the requested output is generated, and patch output remains the default. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 2d541d9ab..a3e47a76e 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -201,8 +201,6 @@ void diff_no_index(struct rev_info *revs,
no_index ? "--no-index" : "[--no-index]");
diff_setup(&revs->diffopt);
- if (!revs->diffopt.output_format)
- revs->diffopt.output_format = DIFF_FORMAT_PATCH;
for (i = 1; i < argc - 2; ) {
int j;
if (!strcmp(argv[i], "--no-index"))
@@ -248,6 +246,8 @@ void diff_no_index(struct rev_info *revs,
revs->diffopt.paths = argv + argc - 2;
revs->diffopt.nr_paths = 2;
revs->diffopt.skip_stat_unmatch = 1;
+ if (!revs->diffopt.output_format)
+ revs->diffopt.output_format = DIFF_FORMAT_PATCH;
DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
DIFF_OPT_SET(&revs->diffopt, NO_INDEX);