aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/deb/git.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-04-23 11:15:16 +0200
committerGuido Günther <agx@sigxcpu.org>2018-04-23 11:29:49 +0200
commit3da92ba2c33074f814309d89fec14d18b6bff269 (patch)
tree608865f87e42ffd1e817fb9819d76d47b13121cd /gbp/deb/git.py
parente730865c03b342e45744540107a3979c441631ac (diff)
import-orig: Better error message when vcs-tag is not found
Closes: #896654
Diffstat (limited to 'gbp/deb/git.py')
-rw-r--r--gbp/deb/git.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gbp/deb/git.py b/gbp/deb/git.py
index 8cda9575..36adcf2b 100644
--- a/gbp/deb/git.py
+++ b/gbp/deb/git.py
@@ -367,7 +367,11 @@ class DebianGitRepository(PkgGitRepository):
def vcs_tag_parent(self, vcs_tag_format, version):
"""If linking to the upstream VCS get the commit id"""
if vcs_tag_format:
- return [self.rev_parse("%s^{}" % self.version_to_tag(vcs_tag_format, version))],
+ try:
+ tag = "%s^{}" % self.version_to_tag(vcs_tag_format, version)
+ return [self.rev_parse(tag)]
+ except GitRepositoryError:
+ raise GitRepositoryError("Can't find upstream vcs tag at '%s'" % tag)
else:
return None