diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-08-08 10:29:11 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-08-08 11:27:32 +0200 |
commit | ea321fdfa1ec917038d09c14036ae9e27108735b (patch) | |
tree | bd4f16e2116880adb5c2515c1c128e48c13c5ca9 /gbp | |
parent | 5a5c9ce3325e368828376fe8fcf8fb2b9a60f151 (diff) |
clone: split out remote name logic
Gbp-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/config.py | 4 | ||||
-rwxr-xr-x | gbp/scripts/pull.py | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/gbp/config.py b/gbp/config.py index 2226e629..76a850de 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -182,6 +182,7 @@ class GbpOptionParser(OptionParser): 'template-dir': '', 'time-machine': 1, 'track': 'True', + 'track-missing': 'False', 'upstream-branch': 'upstream', 'upstream-tag': 'upstream/%(version)s', 'upstream-tree': 'TAG', @@ -301,6 +302,9 @@ class GbpOptionParser(OptionParser): 'track': "Set up tracking for remote branches, " "default is '%(track)s'", + 'track-missing': + "Track missing remote branches, " + "default is '%(track-missing)s'", 'author-is-committer': "Use the authors's name also as the committer's name, " "default is '%(author-is-committer)s'", diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py index 6f58e837..7c665c4a 100755 --- a/gbp/scripts/pull.py +++ b/gbp/scripts/pull.py @@ -120,6 +120,15 @@ def parse_args(argv): return options, args +def get_remote(repo, current): + current_remote = repo.get_merge_branch(current) + if current_remote: + fetch_remote = current_remote.split('/')[0] + else: + fetch_remote = 'origin' + return fetch_remote + + def main(argv): retval = 0 current = None @@ -164,6 +173,7 @@ def main(argv): repo.fetch(rem_repo, depth=options.depth) repo.fetch(rem_repo, depth=options.depth, tags=True) + fetch_remote = get_remote(repo, current) for branch in [options.debian_branch, options.upstream_branch]: if repo.has_branch(branch): branches.add(branch) @@ -172,11 +182,6 @@ def main(argv): branches.add(repo.pristine_tar_branch) if options.all: - current_remote = repo.get_merge_branch(current) - if current_remote: - fetch_remote = current_remote.split('/')[0] - else: - fetch_remote = 'origin' for branch in repo.get_local_branches(): merge_branch = repo.get_merge_branch(branch) if merge_branch: |