summaryrefslogtreecommitdiff
path: root/lib/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-04 13:17:37 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-04 13:17:37 +0100
commitf41d42ee7e264ce2fc32cea555e5f666fa1b1fe9 (patch)
tree1d45b8f6fd8a6114b120e13844cc05e930793297 /lib/git/cmd.py
parentc4cde8df886112ee32b0a09fcac90c28c85ded7f (diff)
downloadgitpython-f41d42ee7e264ce2fc32cea555e5f666fa1b1fe9.tar.gz
Improved cmd error handling in case an invalid revision is specified for an object
repo.tree: improved to be less restricting
Diffstat (limited to 'lib/git/cmd.py')
-rw-r--r--lib/git/cmd.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/git/cmd.py b/lib/git/cmd.py
index 4b4b84af..fb6f2998 100644
--- a/lib/git/cmd.py
+++ b/lib/git/cmd.py
@@ -336,8 +336,9 @@ class Git(object):
"""
tokens = header_line.split()
if len(tokens) != 3:
- raise ValueError( "SHA named %s could not be resolved" % tokens[0] )
-
+ raise ValueError("SHA named %s could not be resolved" % tokens[0] )
+ if len(tokens[0]) != 40:
+ raise ValueError("Failed to parse header: %r" % header_line)
return (tokens[0], tokens[1], int(tokens[2]))
def __prepare_ref(self, ref):