From 699241a2648da20541bdaed5e1c48f1cd4b4e1eb Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 21 Jun 2022 20:30:33 -0700 Subject: [PATCH] git-shell-verify: only check read-only mode for receive-pack Limit the check for read-only mode to only incoming pushes, not everything. Like it was supposed to be in the first place. --- bin/git-shell-verify | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/bin/git-shell-verify b/bin/git-shell-verify index 76180a0..042fcfe 100755 --- a/bin/git-shell-verify +++ b/bin/git-shell-verify @@ -250,19 +250,18 @@ if [ "$type" = 'receive-pack' ] && ! [ -f "$dir/.nofetch" ]; then exit 3 fi -if [ -f "$rofile" ]; then - msgro="$cfg_name is currently read-only, please try again later." - msgro2="" - if [ -s "$rofile" ]; then - msgro2="$(cat "$rofile" 2>/dev/null)" || : - fi - echo "$msgro" >&2 - [ -z "$msgro2" ] || echo "$msgro2" >&2 - exit 3 -fi - GIT_SHELL='git-shell' if [ "$type" = 'receive-pack' ]; then + if [ -f "$rofile" ]; then + msgro="$cfg_name is currently read-only, please try again later." + msgro2="" + if [ -s "$rofile" ]; then + msgro2="$(cat "$rofile" 2>/dev/null)" || : + fi + echo "$msgro" >&2 + [ -z "$msgro2" ] || echo "$msgro2" >&2 + exit 3 + fi git_add_config 'receive.unpackLimit=1' # Note the git config documentation is wrong # transfer.unpackLimit, if set, overrides receive.unpackLimit -- 2.11.4.GIT