summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2011-01-30 16:07:02 -0700
committerJesse Keating <jkeating@redhat.com>2011-01-30 16:07:02 -0700
commit6734b0afba8cc8361392fd40b5b46a11ce0bce09 (patch)
treeef42fd7a3f893319d6d22462f76fbbf7450d37df
parent01137bb7d221de836a0caba93249685b235320af (diff)
downloadfedora-packager-6734b0afba8cc8361392fd40b5b46a11ce0bce09.zip
fedora-packager-6734b0afba8cc8361392fd40b5b46a11ce0bce09.tar.gz
fedora-packager-6734b0afba8cc8361392fd40b5b46a11ce0bce09.tar.xz
Catch the case where there is no branch merge (#619979)
-rw-r--r--src/pyfedpkg/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index aae3105..9c1adf3 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1023,7 +1023,10 @@ class PackageModule:
localbranch = self.repo.active_branch.name
except TypeError, e:
raise FedpkgError('Repo in inconsistent state: %s' % e)
- merge = self.repo.git.config('--get', 'branch.%s.merge' % localbranch)
+ try:
+ merge = self.repo.git.config('--get', 'branch.%s.merge' % localbranch)
+ except git.errors.GitCommandError, e:
+ raise FedpkgError('Unable to find remote branch. Use --dist')
return(merge.split('/')[2])
def _findmasterbranch(self):