From a0b389e9f32689103150c3f63b9b29f4a703211b Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 10 Feb 2017 19:34:52 -0800 Subject: scripts/tree.rc: Don't clobber repository index The repository index should be preserved if writing directly to the / repository. --- scripts/tree.rc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/tree.rc b/scripts/tree.rc index bbc2bd34..be115661 100644 --- a/scripts/tree.rc +++ b/scripts/tree.rc @@ -9,9 +9,11 @@ out=$4 fn checkstatus {} -git -C $repo read-tree --empty -git -C $repo update-index --index-info <$index -tree=`{git -C $repo write-tree} ; checkstatus +GIT_INDEX_FILE=$tag.index { + 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 if([ -e $out ]) { -- cgit v1.2.3