git-server

git server-side stuff | stagit
git clone git://git.ckyln.com/~cem/hooks.git
Log | Files | Refs | README

commit b7ec02433bb14004a5ecc6e32ebe17d15a16f4ec
parent ba859ebf5b85b319cc78b625c8321c4162f12f36
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri, 19 Jun 2020 08:32:09 +0300

post-receive: proper reference handling

Diffstat:
Mpost-receive | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/post-receive b/post-receive @@ -69,7 +69,8 @@ ln -sf log.html index.html # Create archives and plain raw files [ "$ARCHIVE_ALL" = 1 ] || [ -f archive ] && { mkdir -p "$STAGIT_DIR/archive/$repository" - for file in refs/heads/* $(git tag -l); do + for file in $(git show-ref --tags --heads); do + file=${file#* } # Skip tarball recreation for tags, but always recreate branches. case "$file" in refs/heads/*) recreate=1 ;; *) unset recreate; esac @@ -90,7 +91,7 @@ ln -sf log.html index.html } [ "$RAW_ALL" = 1 ] || [ -f raw ] && { - for file in refs/heads/*; do + for file in $(git show-ref --heads); do branch=${file##*/} mkdir -p "$STAGIT_DIR/raw/$repository/$branch" git archive --format tar -- "$branch" |