Package: git-buildpackage
Version: 0.6.31
Severity: normal
Tags: patch

Hello,

When importing into a newly initialised git repository, gbp-import-orig
honours your upstream-branch option, but the debian-branch option is
simply ignored and 'master' is used instead.  I haved attached a patch
which fixes this.

Carlos

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages git-buildpackage depends on:
ii  devscripts            2.15.5
ii  git                   1:2.1.4-2.1
ii  man-db                2.7.0.2-5
ii  python                2.7.9-1
ii  python-dateutil       2.2-2
ii  python-pkg-resources  17.0-1
ii  python-six            1.9.0-3

Versions of packages git-buildpackage recommends:
ii  cowbuilder       0.73
ii  pristine-tar     1.33
ii  python-requests  2.7.0-3

Versions of packages git-buildpackage suggests:
ii  python-notify  0.1.1-4
ii  unzip          6.0-17

-- no debconf information
>From 949e18c21718228fbfdc05638771dec89bab377b Mon Sep 17 00:00:00 2001
From: Carlos Maddela <[email protected]>
Date: Sun, 5 Jul 2015 17:26:10 +1000
Subject: [PATCH] Honour --debian-branch option when importing into an empty
 repo.

---
 gbp/scripts/import_orig.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index a7493ad..45b3789 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -381,6 +381,8 @@ def main(argv):
             if is_empty:
                 repo.create_branch(options.upstream_branch, rev=commit)
                 repo.force_head(options.upstream_branch, hard=True)
+                if options.debian_branch != 'master':
+                    repo.rename_branch('master', options.debian_branch)
             elif options.merge:
                 gbp.log.info("Merging to '%s'" % options.debian_branch)
                 repo.set_branch(options.debian_branch)
-- 
2.1.4

Reply via email to