aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/push.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-01-19 18:27:56 +0100
committerGuido Günther <agx@sigxcpu.org>2018-01-19 18:38:28 +0100
commite1aacbbcb73a12c4eee132f2bbe57a9a6e0e800f (patch)
treefbd4a0c2f2226612b3c9cba558c74a32e089baca /gbp/scripts/push.py
parent5e9ab951b69830d265e7daac1471325a532314a9 (diff)
push: allow to push from detached heads
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: