Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Say what the age hook does with a read-only file
The header said a file the pusher cannot write stays as it was, but the
hook replaces it through mv, which needs only the directory, and with
stdin not a terminal mv does so without asking. That is the useful
behaviour, so the header now says so, and a test holds the hook to it.
Only a directory the pusher cannot write keeps the old file, which was
the one case tested.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0507-hooks.sh | 9 |
1 file changed, 9 insertions, 0 deletions
diff --git a/tests/t0507-hooks.sh b/tests/t0507-hooks.sh index c95c8a3..d387025 100755 --- a/tests/t0507-hooks.sh +++ b/tests/t0507-hooks.sh @@ -187,6 +187,15 @@ do test_cmp expect-entries entries ' + test_expect_success "the age hook replaces a file it cannot write in a directory it can under $shell" ' + rm -f plain.git/info/web/last-modified && + cp kept plain.git/info/web/last-modified && + chmod 444 plain.git/info/web/last-modified && + (cd plain.git && $shell "$HOOK_DIRECTORY/post-receive.cgit-age" 2>../err) && + test_must_be_empty err && + test_cmp expect plain.git/info/web/last-modified + ' + test_expect_success "the age hook leaves a repository with no branches as it was under $shell" ' git init -q --bare tags-$shell.git && git -C work push -q ../tags-$shell.git release && |
