summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-02-15 14:49:22 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-03-08 14:04:00 +0200
commit0c4ae6e3a28fa6c01c171e906fb9e966ab6690a3 (patch)
tree13024473c4de4963f4b08ef37af2903aa7764b67
parent63caf726b1b987d936b074abb32c52dd19f251e0 (diff)
downloadgit-buildpackage-0c4ae6e3a28fa6c01c171e906fb9e966ab6690a3.tar.gz
git-buildpackage-0c4ae6e3a28fa6c01c171e906fb9e966ab6690a3.tar.bz2
git-buildpackage-0c4ae6e3a28fa6c01c171e906fb9e966ab6690a3.zip
gbp-pull: fix guessing of remote repo in --all option
Use 'origin' as the "fetch remote" if the current branch does not have an upstream as this is the remote that git-fetch uses in this case. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/pull.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py
index ffc8159d..e3aa3b3b 100755
--- a/gbp/scripts/pull.py
+++ b/gbp/scripts/pull.py
@@ -145,11 +145,17 @@ def main(argv):
branches.add(repo.pristine_tar_branch)
if options.all:
- current_remote = repo.get_merge_branch(current).split('/')[0]
+ 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():
- rem, rem_br = repo.get_merge_branch(branch).split('/', 1)
- if rem == current_remote and branch == rem_br:
- branches.add(branch)
+ merge_branch = repo.get_merge_branch(branch)
+ if merge_branch:
+ rem, rem_br = merge_branch.split('/', 1)
+ if rem == fetch_remote and branch == rem_br:
+ branches.add(branch)
(ret, out) = repo.is_clean()
if not ret: