chiark / gitweb /
git-debpush: Defend against unexpected git-deborig output
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Jul 2019 22:51:13 +0000 (23:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Jul 2019 10:18:17 +0000 (11:18 +0100)
If git-deborig prints something other than a tag name, for example an
error message (see #931509), this approach will bomb out, roughly
appropriately.

This will also become useful when we make upstream_tag overrideable.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Acked-by: Sean Whitton <spwhitton@spwhitton.name>
git-debpush

index 316d6c1aa80f43cbe59712183c6d119eea22178a..e9b64d4a7fb31a0f3eea4daffdb34c26f83ee214 100755 (executable)
@@ -217,7 +217,7 @@ if $upstream; then
     # xxx want way to override this
     upstream_tag=$(git deborig --just-print --version="$version" \
                        | head -n1)
-    upstream_committish=$(git rev-parse ${upstream_tag}^{})
+    upstream_committish=$(git rev-parse "refs/tags/${upstream_tag}"^{})
     upstream_info=" upstream-tag=$upstream_tag upstream=$upstream_committish"
 fi