diff options
author | Richard Laager <rlaager@wiktel.com> | 2020-08-12 21:58:31 -0500 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2020-09-09 10:53:30 +0200 |
commit | 707ebdfd620ba065533b420e0d401546dadf4f32 (patch) | |
tree | e128e4f1f497823f5fc39e43440474210596e077 | |
parent | 0f8f550aea0fe67bfc98a2c99d9d81223588c117 (diff) |
import-orig: Refactor vcs_tag_parent
This eliminates an indentation level.
-rw-r--r-- | gbp/deb/git.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gbp/deb/git.py b/gbp/deb/git.py index 4b521226..a7015893 100644 --- a/gbp/deb/git.py +++ b/gbp/deb/git.py @@ -375,14 +375,13 @@ 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: - 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: + if not vcs_tag_format: return None + 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) # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: |