@matheusbsbs / matheus-bagliano / commits / 19c29e538e
Fork 0

t4014: make output-directory tests self-contained

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@szeder.dev/ Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bert Wesarg committed Oct 21, 2019 at 15:23 UTC 19c29e538e48ed50286339b0fdd5e62111a724db
1 file changed +8 -5
t/t4014-format-patch.sh
+8 -5
@@ -1615,17 +1615,20 @@ test_expect_success 'format-patch -o with no leading directories' '
1615 '
1616
1617 test_expect_success 'format-patch -o with leading existing directories' '
1618 - git format-patch -o patches/side master..side &&
1618 + rm -rf existing-dir &&
1619 + mkdir existing-dir &&
1620 + git format-patch -o existing-dir/patches master..side &&
1621 count=$(git rev-list --count master..side) &&
1620 - ls patches/side >list &&
1622 + ls existing-dir/patches >list &&
1623 test_line_count = $count list
1624 '
1625
1626 test_expect_success 'format-patch -o with leading non-existing directories' '
1625 - rm -fr patches &&
1626 - git format-patch -o patches/side master..side &&
1627 + rm -rf non-existing-dir &&
1628 + git format-patch -o non-existing-dir/patches master..side &&
1629 count=$(git rev-list --count master..side) &&
1628 - ls patches/side >list &&
1630 + test_path_is_dir non-existing-dir &&
1631 + ls non-existing-dir/patches >list &&
1632 test_line_count = $count list
1633 '
1634