#!/bin/rc -e
. /sys/lib/shithub/common.rc
cd $1
shift
rfork ne
nl='
'
gituser=$1
repo=$2
refname=$3
repons $gituser $repo
if(! ref=`{resolveref $refname}){
echo 'invalid ref '$refname''
exit
}
if(test -f $gitfs/$ref/hash)
hash=`{cat $gitfs/$ref/hash}
if not
hash=$ref
user_prelude $gituser $repo $hash
# list branches in order of last change
branches=`$nl{ls -Qt $gitfs/branch/heads/*/msg}
if(! ~ $#branches 0){
echo -n '
branches:'
for(b in $branches){
branch=`{basename `{basename -d $b}}
if(test -f $gitfs/branch/heads/$branch/hash){
echo -n ' '$branch''
}
}
echo ''
}
echo '
'
done=()
for(f in $descfiles $repodir/^$descfiles)
if(~ $#done 0 && test -f $f){
htcat $f
done=1
}
if(~ $#done 0)
echo 'this repo has no description'
echo '