diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 13:17:37 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 13:17:37 +0100 |
commit | f41d42ee7e264ce2fc32cea555e5f666fa1b1fe9 (patch) | |
tree | 1d45b8f6fd8a6114b120e13844cc05e930793297 /lib/git/cmd.py | |
parent | c4cde8df886112ee32b0a09fcac90c28c85ded7f (diff) | |
download | gitpython-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.py | 5 |
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): |