From f847476ae7388d09ed951422b297c93687f110f8 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 24 Oct 2021 19:39:30 -0400 Subject: style --- EndoForge/src/AnonymousAccessCommand | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/EndoForge/src/AnonymousAccessCommand b/EndoForge/src/AnonymousAccessCommand index b06dd93..5146da4 100755 --- a/EndoForge/src/AnonymousAccessCommand +++ b/EndoForge/src/AnonymousAccessCommand @@ -66,6 +66,20 @@ check_if_self_forge() fi } +with_soul_bare() +{ + ( + set -eC + lockfile=$GIT_DIR/index.lock + echo $$ > "$lockfile" + trap 'rm -f "$lockfile"' EXIT + + git config core.bare true + "$@" + git config core.bare false + ) +} + read authtype authline < "$SSH_USER_AUTH" || exit [ "$authtype" = publickey ] || exit @@ -97,24 +111,9 @@ dir=$(readlink -e "$arg") || exit check_if_self_forge "$dir" -with_allowCurrentBranch() -{ - local cmd="$1" dir="$2" - ( - set -eC - lockfile=$GIT_DIR/index.lock - echo $$ > "$lockfile" - trap 'rm -f "$lockfile"' EXIT - - git config core.bare true - "$@" - git config core.bare false - ) -} - if [ "$GIT_NAMESPACE" ] then - GIT_DIR=$dir with_allowCurrentBranch "$cmd" "$dir" + GIT_DIR=$dir with_soul_bare "$cmd" "$dir" else "$cmd" "$dir" fi -- cgit v1.2.3