summaryrefslogtreecommitdiff
path: root/lib/git/cmd.py
diff options
context:
space:
mode:
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):