diff options
author | Jeff King <peff@peff.net> | 2021-06-18 12:32:22 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-06-19 15:26:05 +0900 |
commit | 7c0afdf23c1cb331eab0068d70ad5c0c156f216a (patch) | |
tree | 09144cf5ea34c8de3b5cbf38408c6216d40a3fd4 /t/t3210-pack-refs.sh | |
parent | ebf3c04b262aa27fbb97f8a0156c2347fecafafb (diff) | |
download | git-7c0afdf23c1cb331eab0068d70ad5c0c156f216a.tar.gz |
t: use portable wrapper for readlink(1)
Not all systems have a readlink program available for use by the shell.
This causes t3210 to fail on at least AIX. Let's provide a perl
one-liner to do the same thing, and use it there.
I also updated calls in t9802. Nobody reported failure there, but it's
the same issue. Presumably nobody actually tests with p4 on AIX in the
first place (if it is even available there).
I left the use of readlink in the "--valgrind" setup in test-lib.sh, as
valgrind isn't available on exotic platforms anyway (and I didn't want
to increase dependencies between test-lib.sh and test-lib-functions.sh).
There's one other curious case. Commit d2addc3b96 (t7800: readlink may
not be available, 2016-05-31) fixed a similar case. We can't use our
wrapper function there, though, as it's inside a sub-script triggered by
Git. It uses a slightly different technique ("ls" piped to "sed"). I
chose not to use that here as it gives confusing "ls -l" output if the
file is unexpectedly not a symlink (which is OK for its limited use, but
potentially confusing for general use within the test suite). The perl
version emits the empty string.
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3210-pack-refs.sh')
-rwxr-xr-x | t/t3210-pack-refs.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index 3b7cdc56ec..577f32dc71 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -253,7 +253,7 @@ test_expect_success SYMLINKS 'pack symlinked packed-refs' ' git for-each-ref >all-refs-packed && test_cmp all-refs-before all-refs-packed && test -h .git/packed-refs && - test "$(readlink .git/packed-refs)" = "my-deviant-packed-refs" + test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs" ' test_done |