summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-30 14:07:15 -0700
committerJunio C Hamano <gitster@pobox.com>2017-03-30 14:07:15 -0700
commit49a8fe8e962ed929cf5bed5520e581025f5bfe9a (patch)
treead3ea9fb0b4653e801eb51390c5695e26201de13 /t
parent3736c925580f678f601d670983f7f6cda791d108 (diff)
parenta54e938e5b53c76ebcd5c068a4f74739c1c68bac (diff)
downloadgit-49a8fe8e962ed929cf5bed5520e581025f5bfe9a.tar.gz
Merge branch 'rs/freebsd-getcwd-workaround'
FreeBSD implementation of getcwd(3) behaved differently when an intermediate directory is unreadable/unsearchable depending on the length of the buffer provided, which our strbuf_getcwd() was not aware of. strbuf_getcwd() has been taught to cope with it better. * rs/freebsd-getcwd-workaround: strbuf: support long paths w/o read rights in strbuf_getcwd() on FreeBSD
Diffstat (limited to 't')
-rwxr-xr-xt/t0001-init.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index e424de5363..c4814d248f 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -315,6 +315,20 @@ test_expect_success 'init with separate gitdir' '
test_path_is_dir realgitdir/refs
'
+test_expect_success 'init in long base path' '
+ # exceed initial buffer size of strbuf_getcwd()
+ component=123456789abcdef &&
+ test_when_finished "chmod 0700 $component; rm -rf $component" &&
+ p31=$component/$component &&
+ p127=$p31/$p31/$p31/$p31 &&
+ mkdir -p $p127 &&
+ chmod 0111 $component &&
+ (
+ cd $p127 &&
+ git init newdir
+ )
+'
+
test_expect_success 're-init on .git file' '
( cd newdir && git init )
'