* [PATCH] commit-id, tree-id fail on tags
@ 2005-08-17 4:27 Pavel Roskin
0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2005-08-17 4:27 UTC (permalink / raw)
To: Petr Baudis, git
Hello!
Tag names don't work with current cogito because commit-id and tree-id
don't parse the cg-Xnormid output properly.
Namely, if $type is empty (which is the case for tags), $normid is used
before the trailing space is stripped from it.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/commit-id b/commit-id
--- a/commit-id
+++ b/commit-id
@@ -9,8 +9,9 @@
id="$1"
normid=$(. ${COGITO_LIB}cg-Xnormid "$id") || exit 1
-type=${normid#* }; [ "$type" ] || type=$(git-cat-file -t "$normid")
+type=${normid#* }
normid=${normid% *}
+[ "$type" ] || type=$(git-cat-file -t "$normid")
if [ "$type" != "commit" ]; then
echo "Invalid commit id: $normid" >&2
diff --git a/tree-id b/tree-id
--- a/tree-id
+++ b/tree-id
@@ -7,8 +7,9 @@
id="$1"
normid=$(. ${COGITO_LIB}cg-Xnormid "$id") || exit 1
-type=${normid#* }; [ "$type" ] || type=$(git-cat-file -t "$normid")
+type=${normid#* }
normid=${normid% *}
+[ "$type" ] || type=$(git-cat-file -t "$normid")
if [ "$type" = "commit" ]; then
normid=$(git-cat-file commit "$normid" | sed -e 's/tree //;q')
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-17 4:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-17 4:27 [PATCH] commit-id, tree-id fail on tags Pavel Roskin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.