aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/pull.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-08-08 10:29:11 +0200
committerGuido Günther <agx@sigxcpu.org>2018-08-08 11:27:32 +0200
commitea321fdfa1ec917038d09c14036ae9e27108735b (patch)
treebd4f16e2116880adb5c2515c1c128e48c13c5ca9 /gbp/scripts/pull.py
parent5a5c9ce3325e368828376fe8fcf8fb2b9a60f151 (diff)
clone: split out remote name logic
Gbp-Dch: Ignore
Diffstat (limited to 'gbp/scripts/pull.py')
-rwxr-xr-xgbp/scripts/pull.py15
1 files changed, 10 insertions, 5 deletions
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: