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/commit.rc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'scripts/commit.rc') diff --git a/scripts/commit.rc b/scripts/commit.rc index e7b5d468..870d7ab3 100644 --- a/scripts/commit.rc +++ b/scripts/commit.rc @@ -9,13 +9,11 @@ out=$4 fn checkstatus {} -wd=`{pwd} -cd $repo - -if([ -f refs/heads/$branch ]) parent=(-p $branch) +if(git -C $repo show-ref -q --verify refs/heads/$branch) + parent=(-p $branch) if not parent=() message='oasis built by '`{id -un} -commit=`{echo $message | git commit-tree $tag $parent} ; checkstatus -git update-ref refs/heads/$branch $commit -ln -f refs/heads/$branch $wd/$out +commit=`{echo $message | git -C $repo commit-tree $tag $parent} ; checkstatus +git -C $repo update-ref refs/heads/$branch $commit +echo $commit > $out.tmp && mv $out.tmp $out -- cgit v1.2.3