diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/hash.rc | 6 | ||||
| -rw-r--r-- | scripts/tree.rc | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/scripts/hash.rc b/scripts/hash.rc index 9b715308..3d7235d7 100644 --- a/scripts/hash.rc +++ b/scripts/hash.rc @@ -8,6 +8,11 @@ mode=$3 name=$4 shift 4 +fn checkstatus { + s=$status if(! ~ $s '' '|') exit $s + status=() +} + hash=`{ switch($mode) { case 120??? @@ -16,6 +21,7 @@ hash=`{ git -C $repo hash-object -w --stdin <$1 } } +checkstatus printf '%s %s\t%s\n' $mode $hash $name >$out.tmp mv $out.tmp $out diff --git a/scripts/tree.rc b/scripts/tree.rc index ed7a81bb..1ace9935 100644 --- a/scripts/tree.rc +++ b/scripts/tree.rc @@ -6,10 +6,15 @@ repo=$1 tag=$2 shift 2 +fn checkstatus { + s=$status if(! ~ $s '' '|') exit $s + status=() +} + ifs=() { oldpwd=`{pwd | head -c -1} } cd $repo git read-tree --empty cat $oldpwd/$* | git update-index --index-info -tree=`{git write-tree} +tree=`{git write-tree} ; checkstatus git update-ref refs/tags/$tag $tree |
