summaryrefslogtreecommitdiff
path: root/scripts/tree.rc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tree.rc')
-rw-r--r--scripts/tree.rc19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/tree.rc b/scripts/tree.rc
new file mode 100644
index 00000000..8d71ffe2
--- /dev/null
+++ b/scripts/tree.rc
@@ -0,0 +1,19 @@
+#!/bin/rc
+
+flag e +
+
+repo=$1
+out=$2
+shift 2
+
+ifs=() { oldpwd=`{pwd | head -c -1} }
+cd $repo
+
+git read-tree --empty
+cat $oldpwd/$* | git update-index --index-info
+tree=`{git write-tree}
+git update-ref refs/tags/tree $tree
+
+cd $oldpwd
+echo $tree >$out.tmp
+mv $out.tmp $out