ref: c5847bcde2ed8d1e5891e79b186a14e46cfa0bfa
dir: /tar/
#!/bin/rc
. /sys/lib/shithub/common.rc
cd $1
shift
rfork ne
nl='
'
gituser=$1
repo=$2
refname=$3
filename=$repo^'-'^`{date -f 'YYYYMMDD-hhmm'}^'.tgz'
repons $gituser $repo
if(! ref=`{resolveref $refname}){
echo '<b>invalid ref '$refname'</b>'
exit
}
bind $gitfs/$ref/tree /mnt/$repo
cd /mnt
http_response 'application/x-gzip' $filename
tar c $repo | gzip -n