summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-02-10 19:34:52 -0800
committerMichael Forney <mforney@mforney.org>2017-02-10 19:34:52 -0800
commita0b389e9f32689103150c3f63b9b29f4a703211b (patch)
tree9bb10659cbe334eda1b1b74240abfe9cd3f9d928 /scripts
parent3ce1f65b20c4f261d484572ad60e682041c94d43 (diff)
scripts/tree.rc: Don't clobber repository index
The repository index should be preserved if writing directly to the / repository.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/tree.rc8
1 files changed, 5 insertions, 3 deletions
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 ]) {