summaryrefslogtreecommitdiff
path: root/test/git/test_refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-12-04 14:20:41 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-12-07 10:08:34 +0100
commitf6102b349cbef03667d5715fcfae3161701a472d (patch)
treee5aecf8797a9c7895c5b2809a6bbf5ee7fb2591a /test/git/test_refs.py
parentac4133f51817145e99b896c7063584d4dd18ad59 (diff)
downloadgitpython-f6102b349cbef03667d5715fcfae3161701a472d.tar.gz
Reference: reading of commit data is now safer and handles non-existing paths - previously it would run into a code-branch I forgot
Diffstat (limited to 'test/git/test_refs.py')
-rw-r--r--test/git/test_refs.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/git/test_refs.py b/test/git/test_refs.py
index 584f6e89..2cddf862 100644
--- a/test/git/test_refs.py
+++ b/test/git/test_refs.py
@@ -274,6 +274,10 @@ class TestRefs(TestBase):
assert ref_new_name.object == orig_obj
assert ref_new_name == ref
# END for each name type
+
+ # References that don't exist trigger an error if we want to access them
+ self.failUnlessRaises(ValueError, getattr, Reference(rw_repo, "refs/doesntexist"), 'commit')
+
# exists, fail unless we force
ex_ref_path = far_away_head.path
self.failUnlessRaises(OSError, ref.rename, ex_ref_path)