#!/bin/rc -e . /sys/lib/shithub/common.rc cd $1shift rfork nenl='' gituser=$1repo=$2refname=$3 repons $gituser $repoif(! ref=`{resolveref $refname}){ echo '<b>invalid ref '$refname'</b>' exit} if(test -f $gitfs/$ref/hash) hash=`{cat $gitfs/$ref/hash}if not hash=$ref user_prelude $gituser $repo $hash echo ' <h3>Branches</h3> <div>' branches=`$nl{ls -Qp $gitfs/branch/heads}if(~ $#branches 0){ echo '<b>no branches found</b>' exit} for(branch in $branches){ if(test -f $gitfs/branch/heads/$branch/hash){ bhash=`{cat $gitfs/branch/heads/$branch/hash} echo ' <h4>'$branch'</h4>' formatcommit $gituser $repo $bhash }} echo ' </div> </body> </html>'
#!/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 '<b>invalid ref '$refname'</b>'
exit
}
if(test -f $gitfs/$ref/hash)
hash=`{cat $gitfs/$ref/hash}
if not
hash=$ref
user_prelude $gituser $repo $hash
echo ' <h3>Branches</h3>
<div>'
branches=`$nl{ls -Qp $gitfs/branch/heads}
if(~ $#branches 0){
echo '<b>no branches found</b>'
exit
}
for(branch in $branches){
if(test -f $gitfs/branch/heads/$branch/hash){
bhash=`{cat $gitfs/branch/heads/$branch/hash}
echo ' <h4>'$branch'</h4>'
formatcommit $gituser $repo $bhash
}
}
echo ' </div>
</body>
</html>
'