Improve sha1 object file writing.
[git/git.git] / git-tag-script
CommitLineData
65f0d0ee
LT
1#!/bin/sh
2object=${2:-$(cat .git/HEAD)}
0fc65a45 3type=$(git-cat-file -t $object) || exit 1
65f0d0ee
LT
4( echo -e "object $object\ntype $type\ntag $1\n"; cat ) > .tmp-tag
5rm -f .tmp-tag.asc
6gpg -bsa .tmp-tag && cat .tmp-tag.asc >> .tmp-tag
7git-mktag < .tmp-tag
8#rm .tmp-tag .tmp-tag.sig