[PATCH] t4014: make output-directory tests self-contained

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As noted by Gábor in [1], the new tests in edefc31873 ("format-patch:
create leading components of output directory", 2019-10-11) cannot be
run independently. Fix this.

[1] https://public-inbox.org/git/20191011144650.GM29845@xxxxxxxxxx/

Signed-off-by: Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx>
---
Cc: Denton Liu <liu.denton@xxxxxxxxx>
Cc: Junio C Hamano <gitster@xxxxxxxxx>
Cc: SZEDER Gábor <szeder.dev@xxxxxxxxx>
---
 t/t4014-format-patch.sh | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 9facc3a79e..b8969998b5 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1615,17 +1615,20 @@ test_expect_success 'format-patch -o with no leading directories' '
 '
 
 test_expect_success 'format-patch -o with leading existing directories' '
-	git format-patch -o patches/side master..side &&
+	rm -rf existing-dir &&
+	mkdir existing-dir &&
+	git format-patch -o existing-dir/patches master..side &&
 	count=$(git rev-list --count master..side) &&
-	ls patches/side >list &&
+	ls existing-dir/patches >list &&
 	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o with leading non-existing directories' '
-	rm -fr patches &&
-	git format-patch -o patches/side master..side &&
+	rm -rf non-existing-dir &&
+	git format-patch -o non-existing-dir/patches master..side &&
 	count=$(git rev-list --count master..side) &&
-	ls patches/side >list &&
+	test_path_is_dir non-existing-dir &&
+	ls non-existing-dir/patches >list &&
 	test_line_count = $count list
 '
 
-- 
2.23.0.13.g28bc381d7c




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux