diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-07 15:02:39 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-07 15:05:22 +0100 |
commit | 34b2390ae2a74a1e0ee9f3bffcc337505e6d5b3a (patch) | |
tree | 3479cac3fb0043243eecc29790c2da41d3b18bee /gbp/scripts/import_orig.py | |
parent | 7d6f61af0a1c7416cf60166300586d9d74dc9cdb (diff) |
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.
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r-- | gbp/scripts/import_orig.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |