From 63bc97cc26be1ae474e831bd7cc9c3c519d69f50 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Wed, 14 Oct 2020 14:13:43 -0400 Subject: fix HEAD issue --- bin/samizdat-ssh-command | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin/samizdat-ssh-command') 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() maybe_initialize_heads() { [ "$GIT_NAMESPACE" ] || die 'Programmer error' + local head heads heads=$git_dir/refs/namespaces/$GIT_NAMESPACE/refs/heads - mkdir -p "$heads" - found_file=$(find "$heads" -type f -print -quit) - [ "$found_file" ] && return - [ -e "$git_dir/refs/heads/master" ] && cp "$git_dir/refs/heads/master" "$heads" - # TODO: copy actual file 'HEAD' and whatever it references + head=$git_dir/refs/namespaces/$GIT_NAMESPACE/HEAD + + mkdir -p "$heads" || die 'failed to mkdir $heads' + [ -e "$head" ] || cp -T "$git_dir"/HEAD "$head" } @@ -295,7 +295,7 @@ if [ "$git_cmd" = 'git-upload-pack' ]; then fi if [ "$git_ns" -a -e "$git_dir/refs/namespaces/$git_ns" ]; then export GIT_NAMESPACE="$git_ns" - # maybe_initialize_heads + maybe_initialize_heads fi exec "$git_cmd" "$git_dir" ;; -- cgit v1.2.3