diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-03-11 22:18:27 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-03-12 21:38:26 +0100 |
commit | 9bb73b46d2f215dc70482e55311a64debeca4d6e (patch) | |
tree | acfc2c46d1440bbd4faea9521a5f245771414672 /gbp | |
parent | 22d4b62d032894cec48cd725b42962291af63abf (diff) |
git: improve error handling for commit_tree
Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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={}): |