summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-28 08:16:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-28 08:16:46 (GMT)
commitb0085a716770d9d2876edd74c6119c48d9d6f232 (patch)
tree3658953cbb5a9a2fd1bab5fe0bf80781a6362383 /diff-no-index.c
parenta1b1ae0571f6b57117678aeaa1939d97c992a254 (diff)
parent9d5156496d2d32800df52fa372295c16ab2578f0 (diff)
downloadgit-b0085a716770d9d2876edd74c6119c48d9d6f232.zip
git-b0085a716770d9d2876edd74c6119c48d9d6f232.tar.gz
git-b0085a716770d9d2876edd74c6119c48d9d6f232.tar.bz2
Merge branch 'maint'
* maint: test-lib: Clean up comments and Makefile. diff --no-index: Do not generate patch output if other output is requested
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 598687b..42c1dd8 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -205,8 +205,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"))
@@ -252,6 +250,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);