aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-03-11 22:18:27 +0100
committerGuido Günther <agx@sigxcpu.org>2011-03-12 21:38:26 +0100
commit9bb73b46d2f215dc70482e55311a64debeca4d6e (patch)
treeacfc2c46d1440bbd4faea9521a5f245771414672 /gbp
parent22d4b62d032894cec48cd725b42962291af63abf (diff)
git: improve error handling for commit_tree
Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/gbp/git.py b/gbp/git.py
index cf85f0a0..dc648a12 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -64,9 +64,7 @@ class GitRepository(object):
stdout=subprocess.PIPE,
env=env)
(stdout, stderr) = popen.communicate(input)
- if popen.returncode:
- stdout = None
- return stdout
+ return stdout, stderr, popen.returncode
def base_dir(self):
"""Base of the repository"""
@@ -393,8 +391,11 @@ class GitRepository(object):
args = [ tree ]
for parent in parents:
args += [ '-p' , parent ]
- sha1 = self.__git_inout('commit-tree', args, msg, extra_env).strip()
- return sha1
+ sha1, stderr, ret = self.__git_inout('commit-tree', args, msg, extra_env)
+ if not ret:
+ return sha1.strip()
+ else:
+ raise GbpError, "Failed to commit tree: %s" % stderr
def commit_dir(self, unpack_dir, msg, branch, other_parents=None,
author={}, committer={}):