summaryrefslogtreecommitdiff
path: root/scripts/tree.rc
blob: 289162245aff8601b0c45fac950a5a18b66f68a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/rc

flag e +

repo=$1
tag=$2
index=$3

fn checkstatus {
	s=$status if(! ~ $s '' '|') exit $s
	status=()
}

ifs=() { oldcwd=`{pwd | head -c -1} }
cd $repo

git read-tree --empty
git update-index --index-info <$oldcwd/$index
tree=`{git write-tree} ; checkstatus
git update-ref refs/tags/$tag $tree