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)
+ dummy, err, ret = self._git_inout('branch',
+ ['--set-upstream',
+ local_branch,
+ upstream],
+ capture_stderr=True)
+ if ret:
+ raise GitRepositoryError(
+ "Failed to set upstream branch '%s' for '%s': %s" %
+ (upstream, local_branch, err.strip()))
def get_upstream_branch(self, local_branch):
"""