GitRepository.set_upstream_branch: don't try to set upstream twice
authorGuido Günther <agx@sigxcpu.org>
Thu, 4 Jul 2013 15:45:54 +0000 (17:45 +0200)
committerGuido Günther <agx@sigxcpu.org>
Thu, 4 Jul 2013 15:51:58 +0000 (17:51 +0200)
Move setting of the upstream branch out of the loop. This worked by
accident.

gbp/git/repository.py

index 11aff4fd82599d9ee8b216b61601ccf5b8ae5e97..e172aad68af80ff7c260a822309ee1e829370a73 100644 (file)
@@ -538,8 +538,8 @@ class GitRepository(object):
             if not self.has_branch(branch, remote=remote):
                 raise GitRepositoryError("Branch %s doesn't exist!" % branch)
 
-            self._git_inout('branch', ["--set-upstream", local_branch, upstream],
-                            capture_stderr=True)
+        self._git_inout('branch', ["--set-upstream", local_branch, upstream],
+                        capture_stderr=True)
 
     def get_upstream_branch(self, local_branch):
         """