1
0
mirror of https://github.com/git/git.git synced 2024-09-25 06:21:42 +02:00
git/t/helper
Ævar Arnfjörð Bjarmason 482e1488a9 t0001: fix broken not-quite getcwd(3) test in bed67874e2
With a54e938e5b (strbuf: support long paths w/o read rights in
strbuf_getcwd() on FreeBSD, 2017-03-26) we had t0001 break on systems
like OpenBSD and AIX whose getcwd(3) has standard (but not like glibc
et al) behavior.

This was partially fixed in bed67874e2 (t0001: skip test with
restrictive permissions if getpwd(3) respects them, 2017-08-07).

The problem with that fix is that while its analysis of the problem is
correct, it doesn't actually call getcwd(3), instead it invokes "pwd
-P". There is no guarantee that "pwd -P" is going to call getcwd(3),
as opposed to e.g. being a shell built-in.

On AIX under both bash and ksh this test breaks because "pwd -P" will
happily display the current working directory, but getcwd(3) called by
the "git init" we're testing here will fail to get it.

I checked whether clobbering the $PWD environment variable would
affect it, and it didn't. Presumably these shells keep track of their
working directory internally.

There's possible follow-up work here in teaching strbuf_getcwd() to
get the working directory with whatever method "pwd" uses on these
platforms. See [1] for a discussion of that, but let's take the easy
way out here and just skip these tests by fixing the
GETCWD_IGNORES_PERMS prerequisite to match the limitations of
strbuf_getcwd().

1. https://lore.kernel.org/git/b650bef5-d739-d98d-e9f1-fa292b6ce982@web.de/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-30 10:18:27 -07:00
..
.gitignore
test-advise.c
test-bitmap.c t/helper/test-bitmap.c: initial commit 2021-03-31 23:14:03 -07:00
test-bloom.c Merge branch 'cc/test-helper-bloom-usage-fix' 2021-04-13 15:28:52 -07:00
test-chmtime.c
test-config.c
test-crontab.c
test-ctype.c
test-date.c
test-delta.c
test-dir-iterator.c
test-drop-caches.c
test-dump-cache-tree.c
test-dump-fsmonitor.c
test-dump-split-index.c
test-dump-untracked-cache.c
test-example-decorate.c lookup_unknown_object(): take a repository argument 2021-04-13 13:18:46 -07:00
test-fake-ssh.c
test-fast-rebase.c
test-genrandom.c
test-genzeros.c
test-getcwd.c t0001: fix broken not-quite getcwd(3) test in bed67874e2 2021-07-30 10:18:27 -07:00
test-hash-speed.c
test-hash.c
test-hashmap.c
test-index-version.c
test-json-writer.c
test-lazy-init-name-hash.c
test-match-trees.c
test-mergesort.c
test-mktemp.c
test-oid-array.c
test-oidmap.c
test-online-cpus.c
test-parse-options.c
test-parse-pathspec-file.c
test-path-utils.c t0060: test ntfs/hfs-obscured dotfiles 2021-05-04 11:52:02 +09:00
test-pcre2-config.c
test-pkt-line.c
test-prio-queue.c
test-proc-receive.c
test-progress.c
test-reach.c
test-read-cache.c test-tool: don't force full index 2021-03-30 12:57:46 -07:00
test-read-graph.c
test-read-midx.c t/helper/test-read-midx.c: add '--show-objects' 2021-03-30 12:16:56 -07:00
test-ref-store.c
test-regex.c
test-repository.c
test-revision-walking.c
test-run-command.c
test-scrap-cache-tree.c
test-serve-v2.c
test-sha1.c
test-sha1.sh
test-sha256.c
test-sigchain.c
test-simple-ipc.c
test-strcmp-offset.c
test-string-list.c
test-submodule-config.c
test-submodule-nested-repo-config.c hash: provide per-algorithm null OIDs 2021-04-27 16:31:39 +09:00
test-subprocess.c
test-tool.c t0001: fix broken not-quite getcwd(3) test in bed67874e2 2021-07-30 10:18:27 -07:00
test-tool.h t0001: fix broken not-quite getcwd(3) test in bed67874e2 2021-07-30 10:18:27 -07:00
test-trace2.c
test-urlmatch-normalization.c
test-userdiff.c userdiff tests: list builtin drivers via test-tool 2021-04-08 12:19:10 -07:00
test-wildmatch.c
test-windows-named-pipe.c
test-write-cache.c
test-xml-encode.c