File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -315,18 +315,44 @@ test_expect_success 'init with separate gitdir' '
315315 test_path_is_dir realgitdir/refs
316316'
317317
318- test_expect_success ' init in long base path' '
318+ test_lazy_prereq GETCWD_IGNORES_PERMS '
319+ base=GETCWD_TEST_BASE_DIR &&
320+ mkdir -p $base/dir &&
321+ chmod 100 $base ||
322+ error "bug in test script: cannot prepare $base"
323+
324+ (cd $base/dir && /bin/pwd -P)
325+ status=$?
326+
327+ chmod 700 $base &&
328+ rm -rf $base ||
329+ error "bug in test script: cannot clean $base"
330+ return $status
331+ '
332+
333+ check_long_base_path () {
319334 # exceed initial buffer size of strbuf_getcwd()
320335 component=123456789abcdef &&
321336 test_when_finished " chmod 0700 $component ; rm -rf $component " &&
322337 p31=$component /$component &&
323338 p127=$p31 /$p31 /$p31 /$p31 &&
324339 mkdir -p $p127 &&
325- chmod 0111 $component &&
340+ if test $# = 1
341+ then
342+ chmod $1 $component
343+ fi &&
326344 (
327345 cd $p127 &&
328346 git init newdir
329347 )
348+ }
349+
350+ test_expect_success ' init in long base path' '
351+ check_long_base_path
352+ '
353+
354+ test_expect_success GETCWD_IGNORES_PERMS ' init in long restricted base path' '
355+ check_long_base_path 0111
330356'
331357
332358test_expect_success ' re-init on .git file' '
You can’t perform that action at this time.
0 commit comments