summaryrefslogtreecommitdiff
path: root/git-tag-script
diff options
context:
space:
mode:
Diffstat (limited to 'git-tag-script')
-rwxr-xr-xgit-tag-script6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-tag-script b/git-tag-script
index ccc75dc..281d192 100755
--- a/git-tag-script
+++ b/git-tag-script
@@ -1,5 +1,9 @@
#!/bin/sh
-object=${2:-$(cat .git/HEAD)}
+# Copyright (c) 2005 Linus Torvalds
+
+: ${GIT_DIR=.git}
+
+object=${2:-$(cat "$GIT_DIR"/HEAD)}
type=$(git-cat-file -t $object) || exit 1
( echo -e "object $object\ntype $type\ntag $1\n"; cat ) > .tmp-tag
rm -f .tmp-tag.asc