Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Replace a read-only age file without asking
mv asks before replacing a file it cannot write when stdin is a
terminal, and the age hook sends the question to /dev/null. git always
gives a hook a pipe, but a hook run by hand from a terminal waited on
an answer no one could see and then kept the old date.
| -rwxr-xr-x | custom/hooks/post-receive.cgit-age | 2 |
1 file changed, 1 insertion, 1 deletion
diff --git a/custom/hooks/post-receive.cgit-age b/custom/hooks/post-receive.cgit-age index 5fdffa9..243a655 100755 --- a/custom/hooks/post-receive.cgit-age +++ b/custom/hooks/post-receive.cgit-age @@ -44,4 +44,4 @@ mkdir -p "$(dirname "$agefile")" 2>/dev/null || exit 0 tmpfile="$agefile.$$" trap 'rm -f "$tmpfile"' EXIT { printf '%s\n' "$date" >"$tmpfile"; } 2>/dev/null || exit 0 -mv "$tmpfile" "$agefile" 2>/dev/null || : +mv -f "$tmpfile" "$agefile" 2>/dev/null || : |
