diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-10-23 21:18:18 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-10-23 21:25:48 +0200 |
commit | 01da1e61b003aa7cb576fbe5755a665a12c3f2ba (patch) | |
tree | 264ffde1933902d5463f9e13109e3b0fe2c31e7f /gbp/scripts/import_dsc.py | |
parent | f18d6b4c2ce098bc12bf4e7fc29dfec7dc16d581 (diff) |
import-dsc: make sure we don't create 'master' if not needed
This way we only get the debian- and upstream-branch in empty repos and
not a pointless 'master' if debian-branch is not set to master.
It also makes sure we don't need --create-missing-branches on empty
repos where it is pointless.
Closes: #750962
Diffstat (limited to 'gbp/scripts/import_dsc.py')
-rw-r--r-- | gbp/scripts/import_dsc.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py index 8bc8c25f..282d2ff3 100644 --- a/gbp/scripts/import_dsc.py +++ b/gbp/scripts/import_dsc.py @@ -258,13 +258,18 @@ def import_upstream(repo, source, dsc, options): author=author, committer=committer) + # if the repo was just created make sure debian branch is in .git/HEAD + # and upstream points to the first commit + if repo.empty: + if repo.branch != options.debian_branch: + repo.rename_branch(repo.branch, options.debian_branch) + repo.create_branch(options.upstream_branch, options.debian_branch) + repo.create_tag(name=tag, msg=msg, commit=commit, sign=options.sign_tags, keyid=options.keyid) - if repo.empty and not repo.has_branch(options.upstream_branch): - repo.create_branch(options.upstream_branch, commit) return commit |