Hello,

Does this patch need any changes before applying? Please let me know.
For convenience, I have attached a .patch file for easy application,
and opened a Pull Request on GitHub with this same patch:
https://github.com/agx/git-buildpackage/pull/72

This program is awesome, thank you for all of your hard work.

Best regards,

Jonathan Rubenstein
jrub...@gmail.com

diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 8c489bfb..f6d035ef 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -328,10 +328,11 @@ def check_branch(repo, options):
     branch = None
     try:
         branch = repo.get_branch()
-    except GitRepositoryError:
+    except GitRepositoryError as repo_error:
         # Not being on any branch is o.k. with --git-ignore-branch
         if not options.ignore_branch:
-            raise
+            gbp.log.err(repo_error)
+            raise GbpError("Use --git-ignore-branch to ignore")
 
     ignore = options.ignore_new or options.ignore_branch
     if branch != options.debian_branch and not ignore:

Reply via email to