diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-02-27 21:08:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-27 21:08:57 +0300 |
commit | b8840a72e25176681eaeea88d9a61aa4a02738cf (patch) | |
tree | a40f8df06d80e230cc2e42ece9c89c1a219bc523 /t | |
parent | 63f74cfbcc608fc2b379680ba4f9181792996081 (diff) | |
parent | 3b0ebb7a8db6e5a1a11dcb2c1f549e4d6037185c (diff) |
Merge branch 'tb/drop-dir-iterator-follow-symlink-bit'
Remove leftover and unused code.
* tb/drop-dir-iterator-follow-symlink-bit:
t0066: drop setup of "dir5"
dir-iterator: drop unused `DIR_ITERATOR_FOLLOW_SYMLINKS`
Diffstat (limited to 't')
-rw-r--r-- | t/helper/test-dir-iterator.c | 6 | ||||
-rwxr-xr-x | t/t0066-dir-iterator.sh | 44 |
2 files changed, 4 insertions, 46 deletions
diff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c index 659b6bfa81..6b297bd753 100644 --- a/t/helper/test-dir-iterator.c +++ b/t/helper/test-dir-iterator.c @@ -15,7 +15,7 @@ static const char *error_name(int error_number) /* * usage: - * tool-test dir-iterator [--follow-symlinks] [--pedantic] directory_path + * tool-test dir-iterator [--pedantic] directory_path */ int cmd__dir_iterator(int argc, const char **argv) { @@ -24,9 +24,7 @@ int cmd__dir_iterator(int argc, const char **argv) int iter_status; for (++argv, --argc; *argv && starts_with(*argv, "--"); ++argv, --argc) { - if (strcmp(*argv, "--follow-symlinks") == 0) - flags |= DIR_ITERATOR_FOLLOW_SYMLINKS; - else if (strcmp(*argv, "--pedantic") == 0) + if (strcmp(*argv, "--pedantic") == 0) flags |= DIR_ITERATOR_PEDANTIC; else die("invalid option '%s'", *argv); diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh index 04b811622b..7d0a0da8c0 100755 --- a/t/t0066-dir-iterator.sh +++ b/t/t0066-dir-iterator.sh @@ -106,13 +106,7 @@ test_expect_success SYMLINKS 'setup dirs with symlinks' ' ln -s d dir4/a/e && ln -s ../b dir4/a/f && - mkdir -p dir5/a/b && - mkdir -p dir5/a/c && - ln -s ../c dir5/a/b/d && - ln -s ../ dir5/a/b/e && - ln -s ../../ dir5/a/b/f && - - ln -s dir4 dir6 + ln -s dir4 dir5 ' test_expect_success SYMLINKS 'dir-iterator should not follow symlinks by default' ' @@ -131,44 +125,10 @@ test_expect_success SYMLINKS 'dir-iterator should not follow symlinks by default test_cmp expected-no-follow-sorted-output actual-no-follow-sorted-output ' -test_expect_success SYMLINKS 'dir-iterator should follow symlinks w/ follow flag' ' - cat >expected-follow-sorted-output <<-EOF && - [d] (a) [a] ./dir4/a - [d] (a/f) [f] ./dir4/a/f - [d] (a/f/c) [c] ./dir4/a/f/c - [d] (b) [b] ./dir4/b - [d] (b/c) [c] ./dir4/b/c - [f] (a/d) [d] ./dir4/a/d - [f] (a/e) [e] ./dir4/a/e - EOF - - test-tool dir-iterator --follow-symlinks ./dir4 >out && - sort out >actual-follow-sorted-output && - - test_cmp expected-follow-sorted-output actual-follow-sorted-output -' - test_expect_success SYMLINKS 'dir-iterator does not resolve top-level symlinks' ' - test_must_fail test-tool dir-iterator ./dir6 >out && + test_must_fail test-tool dir-iterator ./dir5 >out && grep "ENOTDIR" out ' -test_expect_success SYMLINKS 'dir-iterator resolves top-level symlinks w/ follow flag' ' - cat >expected-follow-sorted-output <<-EOF && - [d] (a) [a] ./dir6/a - [d] (a/f) [f] ./dir6/a/f - [d] (a/f/c) [c] ./dir6/a/f/c - [d] (b) [b] ./dir6/b - [d] (b/c) [c] ./dir6/b/c - [f] (a/d) [d] ./dir6/a/d - [f] (a/e) [e] ./dir6/a/e - EOF - - test-tool dir-iterator --follow-symlinks ./dir6 >out && - sort out >actual-follow-sorted-output && - - test_cmp expected-follow-sorted-output actual-follow-sorted-output -' - test_done |