Skip to content

Commit b0085a7

Browse files
committed
Merge branch 'maint'
* maint: test-lib: Clean up comments and Makefile. diff --no-index: Do not generate patch output if other output is requested
2 parents a1b1ae0 + 9d51564 commit b0085a7

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

diff-no-index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ void diff_no_index(struct rev_info *revs,
205205
no_index ? "--no-index" : "[--no-index]");
206206

207207
diff_setup(&revs->diffopt);
208-
if (!revs->diffopt.output_format)
209-
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
210208
for (i = 1; i < argc - 2; ) {
211209
int j;
212210
if (!strcmp(argv[i], "--no-index"))
@@ -252,6 +250,8 @@ void diff_no_index(struct rev_info *revs,
252250
revs->diffopt.paths = argv + argc - 2;
253251
revs->diffopt.nr_paths = 2;
254252
revs->diffopt.skip_stat_unmatch = 1;
253+
if (!revs->diffopt.output_format)
254+
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
255255

256256
DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
257257
DIFF_OPT_SET(&revs->diffopt, NO_INDEX);

t/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pre-clean:
2424
$(RM) -r test-results
2525

2626
clean:
27-
$(RM) -r 'trash directory' test-results
27+
$(RM) -r 'trash directory'.* test-results
2828

2929
aggregate-results-and-cleanup: $(T)
3030
$(MAKE) aggregate-results

t/test-lib.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,6 @@ test_done () {
523523
fi
524524
case "$test_failure" in
525525
0)
526-
# We could:
527-
# cd .. && rm -fr 'trash directory'
528-
# but that means we forbid any tests that use their own
529-
# subdirectory from calling test_done without coming back
530-
# to where they started from.
531-
# The Makefile provided will clean this test area so
532-
# we will leave things as they are.
533-
534526
say_color pass "passed all $msg"
535527

536528
test -d "$remove_trash" &&

0 commit comments

Comments
 (0)