mirror of
https://github.com/oasislinux/oasis.git
synced 2026-02-05 11:33:57 +01:00
25 lines
367 B
Bash
25 lines
367 B
Bash
#!/bin/rc
|
|
|
|
flag e +
|
|
|
|
repo=$1
|
|
tag=$2
|
|
index=$3
|
|
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 -C $repo update-ref refs/tags/$tag $tree
|
|
|
|
if([ -e $out ]) {
|
|
oldtree=`{cat $out} ; checkstatus
|
|
if(~ $tree $oldtree)
|
|
exit 0
|
|
}
|
|
|
|
echo $tree >$out.tmp
|
|
mv $out.tmp $out
|