From 34b2390ae2a74a1e0ee9f3bffcc337505e6d5b3a Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 7 Nov 2017 15:02:39 +0100 Subject: import-orig: avoid master branch when importing into empty repo We dont't want a master branch if debian-branch != 'master'. This change can't be rolled back but that doesn't matter much in an empty repo. --- gbp/scripts/import_orig.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gbp/scripts/import_orig.py') diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index caef3486..b67424e5 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -624,6 +624,13 @@ def main(argv): if is_empty: repo.create_branch(branch=options.debian_branch, rev=commit) repo.force_head(options.debian_branch, hard=True) + # In an empty repo avoid master branch defaulted to by + # git and check out debian branch instead. + if not repo.bare: + cur = repo.branch + if cur != options.debian_branch: + repo.set_branch(options.debian_branch) + repo.delete_branch(cur) elif options.merge: repo.rrr_branch(options.debian_branch) debian_branch_merge(repo, tag, version, options) -- cgit v1.2.3