summaryrefslogtreecommitdiff
path: root/EndoForge
diff options
context:
space:
mode:
Diffstat (limited to 'EndoForge')
-rwxr-xr-xEndoForge/src/AnonymousAccessCommand31
1 files 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()
66 fi 66 fi
67} 67}
68 68
69with_soul_bare()
70{
71 (
72 set -eC
73 lockfile=$GIT_DIR/index.lock
74 echo $$ > "$lockfile"
75 trap 'rm -f "$lockfile"' EXIT
76
77 git config core.bare true
78 "$@"
79 git config core.bare false
80 )
81}
82
69read authtype authline < "$SSH_USER_AUTH" || exit 83read authtype authline < "$SSH_USER_AUTH" || exit
70[ "$authtype" = publickey ] || exit 84[ "$authtype" = publickey ] || exit
71 85
@@ -97,24 +111,9 @@ dir=$(readlink -e "$arg") || exit
97 111
98check_if_self_forge "$dir" 112check_if_self_forge "$dir"
99 113
100with_allowCurrentBranch()
101{
102 local cmd="$1" dir="$2"
103 (
104 set -eC
105 lockfile=$GIT_DIR/index.lock
106 echo $$ > "$lockfile"
107 trap 'rm -f "$lockfile"' EXIT
108
109 git config core.bare true
110 "$@"
111 git config core.bare false
112 )
113}
114
115if [ "$GIT_NAMESPACE" ] 114if [ "$GIT_NAMESPACE" ]
116then 115then
117 GIT_DIR=$dir with_allowCurrentBranch "$cmd" "$dir" 116 GIT_DIR=$dir with_soul_bare "$cmd" "$dir"
118else 117else
119 "$cmd" "$dir" 118 "$cmd" "$dir"
120fi 119fi