summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-10-14 14:13:43 -0400
committerAndrew Cady <d@jerkface.net>2020-10-14 14:13:43 -0400
commit63bc97cc26be1ae474e831bd7cc9c3c519d69f50 (patch)
tree2ab22b4e8fe20034e4b642984f75ceadc64b98bd
parentc0d54dce30ddb38e99397ec7055be7e367797b6e (diff)
fix HEAD issue
-rwxr-xr-xbin/samizdat-ssh-command12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/samizdat-ssh-command b/bin/samizdat-ssh-command
index 3c1bd5d..863e7ee 100755
--- a/bin/samizdat-ssh-command
+++ b/bin/samizdat-ssh-command
@@ -185,12 +185,12 @@ authorized()
185maybe_initialize_heads() 185maybe_initialize_heads()
186{ 186{
187 [ "$GIT_NAMESPACE" ] || die 'Programmer error' 187 [ "$GIT_NAMESPACE" ] || die 'Programmer error'
188 local head heads
188 heads=$git_dir/refs/namespaces/$GIT_NAMESPACE/refs/heads 189 heads=$git_dir/refs/namespaces/$GIT_NAMESPACE/refs/heads
189 mkdir -p "$heads" 190 head=$git_dir/refs/namespaces/$GIT_NAMESPACE/HEAD
190 found_file=$(find "$heads" -type f -print -quit) 191
191 [ "$found_file" ] && return 192 mkdir -p "$heads" || die 'failed to mkdir $heads'
192 [ -e "$git_dir/refs/heads/master" ] && cp "$git_dir/refs/heads/master" "$heads" 193 [ -e "$head" ] || cp -T "$git_dir"/HEAD "$head"
193 # TODO: copy actual file 'HEAD' and whatever it references
194} 194}
195 195
196 196
@@ -295,7 +295,7 @@ if [ "$git_cmd" = 'git-upload-pack' ]; then
295 fi 295 fi
296 if [ "$git_ns" -a -e "$git_dir/refs/namespaces/$git_ns" ]; then 296 if [ "$git_ns" -a -e "$git_dir/refs/namespaces/$git_ns" ]; then
297 export GIT_NAMESPACE="$git_ns" 297 export GIT_NAMESPACE="$git_ns"
298 # maybe_initialize_heads 298 maybe_initialize_heads
299 fi 299 fi
300 exec "$git_cmd" "$git_dir" 300 exec "$git_cmd" "$git_dir"
301 ;; 301 ;;