rpm_ch: check the branch of repo whether exist.
authorwanchao-xu <wanchao.xu@samsung.com>
Mon, 29 Apr 2024 06:17:04 +0000 (14:17 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Mon, 29 Apr 2024 06:17:04 +0000 (14:17 +0800)
Change-Id: I13feeaed486f4aab5189b0e2619c83fbf465f27c
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
gbp/scripts/rpm_ch.py

index bb02e91e547b6a1d6b4f2ee4b6fd46419082a034..b5830dad6adc7e9df488a26dccaffc572b189df9 100644 (file)
@@ -124,10 +124,8 @@ def determine_editor(options):
 
 def check_branch(repo, options):
     """Check the current git branch"""
-    try:
-        branch = repo.get_branch()
-    except GitRepositoryError:
-        branch = None
+    # Check branch
+    branch = repo.get_branch()
     if options.packaging_branch != branch and not options.ignore_branch:
         gbp.log.err("You are not on branch '%s' but on '%s'" %
                     (options.packaging_branch, branch))