summaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/push.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/push.py')
-rwxr-xr-xgbp/scripts/push.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/scripts/push.py b/gbp/scripts/push.py
index 868b0954..e21a022f 100755
--- a/gbp/scripts/push.py
+++ b/gbp/scripts/push.py
@@ -132,10 +132,12 @@ def main(argv):
try:
source = DebianSource(repo.path)
- branch = repo.get_branch()
+ branch = repo.branch
if not options.ignore_branch:
if branch != options.debian_branch:
- gbp.log.err("You are not on branch '%s' but on '%s'" % (options.debian_branch, branch))
+ gbp.log.err("You are not on branch '%s' but %s" %
+ (options.debian_branch,
+ "on '%s'" % branch if branch else 'in detached HEAD state'))
raise GbpError("Use --ignore-branch to ignore or --debian-branch to set the branch name.")
if not dest: