summaryrefslogtreecommitdiff
path: root/repo/fun.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-24 09:37:40 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-24 09:37:40 +0100
commit8dd51f1d63fa5ee704c2bdf4cb607bb6a71817d2 (patch)
tree9a3c15132e7f43f1431570f83c696e4d7d5bea49 /repo/fun.py
parent7029773512eee5a0bb765b82cfdd90fd5ab34e15 (diff)
downloadgitpython-8dd51f1d63fa5ee704c2bdf4cb607bb6a71817d2.tar.gz
Improved refparse error handling in case of out-of-bound indices
Diffstat (limited to 'repo/fun.py')
-rw-r--r--repo/fun.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/repo/fun.py b/repo/fun.py
index 7b842c38..aa938477 100644
--- a/repo/fun.py
+++ b/repo/fun.py
@@ -190,7 +190,12 @@ def rev_parse(repo, rev):
raise NotImplementedError("Support for additional @{...} modes not implemented")
#END handle revlog index
- entry = ref.log()[revlog_index]
+ try:
+ entry = ref.log()[revlog_index]
+ except IndexError:
+ raise BadObject("Invalid revlog index: %i" % revlog_index)
+ #END handle index out of bound
+
obj = Object.new_from_sha(repo, hex_to_bin(entry.newhexsha))
# make it pass the following checks