Diff options
Diffstat (limited to '')
| -rwxr-xr-x | tests/t0507-hooks.sh | 27 |
1 file changed, 25 insertions, 2 deletions
diff --git a/tests/t0507-hooks.sh b/tests/t0507-hooks.sh index 8a45f81..ec31546 100755 --- a/tests/t0507-hooks.sh +++ b/tests/t0507-hooks.sh @@ -32,8 +32,8 @@ test_expect_success 'set up a cache of two repositories and the index' ' CGIT_CONFIG="$PWD/cachedrc" PATH_INFO="$page" QUERY_STRING= cgit >/dev/null || return 1 done && - CGIT_CONFIG="$PWD/cachedrc" QUERY_STRING="url=a.git/refs/" cgit >/dev/null && - CGIT_CONFIG="$PWD/cachedrc" QUERY_STRING="url=b.git/refs/" cgit >/dev/null && + cgit_rc cachedrc "url=a.git/refs/" >/dev/null && + cgit_rc cachedrc "url=b.git/refs/" >/dev/null && echo writer >slots/0123abcd.lock && cp -R slots pristine && sed -e "s|^cache_root=.*|cache_root='\''$PWD/slots'\''|" \ @@ -115,6 +115,29 @@ do " done +for shell in $shells +do + test_expect_success SANITY "the age hook shows a pusher no error under $shell" " + echo kept >kept && + cp kept plain.git/info/web/last-modified && + test_when_finished 'chmod 755 plain.git/info/web' && + chmod 555 plain.git/info/web && + (cd plain.git && $shell \"\$HOOK_DIRECTORY/post-receive.cgit-age\" 2>../err) && + test_must_be_empty err && + test_cmp kept plain.git/info/web/last-modified + " +done + +test_expect_success SANITY 'the age hook shows no error when it cannot make its directory' ' + git init -q --bare closed.git && + git -C work push -q ../closed.git HEAD:refs/heads/main && + test_when_finished "chmod 755 closed.git/info" && + chmod 555 closed.git/info && + (cd closed.git && sh "$HOOK_DIRECTORY/post-receive.cgit-age" 2>../err) && + test_must_be_empty err && + test_path_is_missing closed.git/info/web +' + # git keeps a shared repository group writable whatever the pusher's umask, # and the next member to push has to be able to replace the file. test_expect_success SANITY 'the age hook keeps a shared directory group writable' ' |
