1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
set -eu
case "$(git config --get core.sharedRepository | tr '[:upper:]' '[:lower:]')" in
""|umask|0|false|no|off)
umask 022
;;
*)
umask 002
;;
esac
agefile="$(git rev-parse --git-dir)"/info/web/last-modified
date="$(git for-each-ref --sort=-committerdate --count=1 \
--format='%(committerdate:iso8601)' refs/heads/)"
test -n "$date" || exit 0
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 || :
|