summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git/repository.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index e172aad..0396367 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -538,8 +538,15 @@ 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)
+ 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):
"""