From 36c037effc0ce49beaa5e27caed0343e137013a6 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 29 Dec 2016 23:29:07 -0800 Subject: Allow using /.git as output repository --- scripts/tree.rc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'scripts/tree.rc') diff --git a/scripts/tree.rc b/scripts/tree.rc index 81f641c6..bbc2bd34 100644 --- a/scripts/tree.rc +++ b/scripts/tree.rc @@ -9,11 +9,16 @@ out=$4 fn checkstatus {} -wd=`{pwd} -cd $repo +git -C $repo read-tree --empty +git -C $repo update-index --index-info <$index +tree=`{git -C $repo write-tree} ; checkstatus +git -C $repo update-ref refs/tags/$tag $tree -git read-tree --empty -git update-index --index-info <$wd/$index -tree=`{git write-tree} ; checkstatus -git update-ref refs/tags/$tag $tree -ln -f refs/tags/$tag $wd/$out +if([ -e $out ]) { + oldtree=`{cat $out} ; checkstatus + if(~ $tree $oldtree) + exit 0 +} + +echo $tree >$out.tmp +mv $out.tmp $out -- cgit v1.2.3