import-orig: Refactor vcs_tag_parent
authorRichard Laager <rlaager@wiktel.com>
Thu, 13 Aug 2020 02:59:23 +0000 (21:59 -0500)
committerGuido Günther <agx@sigxcpu.org>
Wed, 9 Sep 2020 08:53:33 +0000 (10:53 +0200)
This makes the "tag" variable just the tag.  This improves the
human-readability of the error message if the tag cannot be found.

gbp/deb/git.py

index a70158930e4ed7aa94e75e192252200a6cbca523..4a17c2dba321bd0018e82269e7cc67354d9fac22 100644 (file)
@@ -378,8 +378,8 @@ class DebianGitRepository(PkgGitRepository):
         if not vcs_tag_format:
             return None
         try:
-            tag = "%s^{}" % self.version_to_tag(vcs_tag_format, version)
-            return [self.rev_parse(tag)]
+            tag = self.version_to_tag(vcs_tag_format, version)
+            return [self.rev_parse("%s^{}" % tag)]
         except GitRepositoryError:
             raise GitRepositoryError("Can't find upstream vcs tag at '%s'" % tag)