aboutsummaryrefslogtreecommitdiff
path: root/services/docker/git-server/hooks
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-03-07 19:15:31 +0800
committerYuqian Yang <crupest@crupest.life>2025-03-07 19:44:36 +0800
commit91690b59663b89bbc3d8c7febe2b046de1424672 (patch)
tree7dbd70ca6ede7f03925b371726246cfa327e1e71 /services/docker/git-server/hooks
parentcb6c8080bc6c6e262a73a8d1c0d21e12ebc3906a (diff)
downloadcrupest-91690b59663b89bbc3d8c7febe2b046de1424672.tar.gz
crupest-91690b59663b89bbc3d8c7febe2b046de1424672.tar.bz2
crupest-91690b59663b89bbc3d8c7febe2b046de1424672.zip
fix(git): public/private repo problem, enable cgit for private.
Diffstat (limited to 'services/docker/git-server/hooks')
-rwxr-xr-xservices/docker/git-server/hooks/update38
1 files changed, 0 insertions, 38 deletions
diff --git a/services/docker/git-server/hooks/update b/services/docker/git-server/hooks/update
deleted file mode 100755
index d6bfc1a..0000000
--- a/services/docker/git-server/hooks/update
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/bash
-
-set -e -o pipefail
-
-ref="$1"
-old="$2"
-new="$3"
-protected_file="$GIT_DIR/protected"
-
-die() {
- echo "error: $*" > /dev/stderr
- exit 1
-}
-
-if [[ -f "$protected_file" ]]; then
- while read -r line; do
- if grep -q -E "$line" - <<< "$ref" ; then
- if grep -q -E "^0+$" <<< "$new"; then
- die "protected branch $ref (rule: $line) cannot be deleted"
- fi
-
- if ! git merge-base --is-ancestor "$old" "$new"; then
- die "protected branch $ref (rule: $line) is not fast-forward $(expr substr "$old" 1 8) -> $(expr substr "$new" 1 8)"
- fi
- fi
- done <"$protected_file"
-fi
-
-global_hook="/git/hooks/update"
-local_hook="$GIT_DIR/hooks/update"
-
-if [[ -x "$global_hook" ]]; then
- "$global_hook" "$ref" "$old" "$new"
-fi
-
-if [[ -x "$local_hook" ]]; then
- "$local_hook" "$ref" "$old" "$new"
-fi