From 5d83f9c19810229bb765ef63864e4f252e83ad61 Mon Sep 17 00:00:00 2001
From: Johannes Sixt <j6t@kdbg.org>
Date: Wed, 25 Mar 2009 18:19:46 +0100
Subject: [PATCH 1/2] 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>
---
 diff-no-index.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diff-no-index.c b/diff-no-index.c
index 2d541d9aba..a3e47a76e4 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);

From 81db4abf84ec7fbebeb08f6ad506138da2e7e4cd Mon Sep 17 00:00:00 2001
From: Emil Sit <sit@emilsit.net>
Date: Fri, 27 Mar 2009 21:57:18 -0400
Subject: [PATCH 2/2] test-lib: Clean up comments and Makefile.

Bring documentation in test-lib and clean target
in Makefile in-line with abc5d372.

Signed-off-by: Emil Sit <sit@emilsit.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/Makefile    | 2 +-
 t/test-lib.sh | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/t/Makefile b/t/Makefile
index ed49c20b16..9149373032 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -24,7 +24,7 @@ pre-clean:
 	$(RM) -r test-results
 
 clean:
-	$(RM) -r 'trash directory' test-results
+	$(RM) -r 'trash directory'.* test-results
 
 aggregate-results-and-cleanup: $(T)
 	$(MAKE) aggregate-results
diff --git a/t/test-lib.sh b/t/test-lib.sh
index fc0e1932e6..1b4f216385 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -441,14 +441,6 @@ test_done () {
 	fi
 	case "$test_failure" in
 	0)
-		# We could:
-		# cd .. && rm -fr 'trash directory'
-		# but that means we forbid any tests that use their own
-		# subdirectory from calling test_done without coming back
-		# to where they started from.
-		# The Makefile provided will clean this test area so
-		# we will leave things as they are.
-
 		say_color pass "passed all $msg"
 
 		test -d "$remove_trash" &&