summaryrefslogtreecommitdiff
path: root/test/git/test_refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-12-04 10:01:43 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-12-04 10:01:43 +0100
commite4ed59a86909b142ede105dd9262915c0e2993ac (patch)
tree1b82a5419233e35e04cfb458a303bbbdcdf4ff14 /test/git/test_refs.py
parent4e729429631c84c3bd5602edcab3e7c2ab1dcce0 (diff)
downloadgitpython-e4ed59a86909b142ede105dd9262915c0e2993ac.tar.gz
SymbolicReference creation now won't fail if the target already exists and has the same content as the new reference
Diffstat (limited to 'test/git/test_refs.py')
-rw-r--r--test/git/test_refs.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/git/test_refs.py b/test/git/test_refs.py
index 762554dc..97617c1b 100644
--- a/test/git/test_refs.py
+++ b/test/git/test_refs.py
@@ -242,7 +242,9 @@ class TestRefs(TestBase):
assert ref.path == full_ref
assert ref.object == rw_repo.head.commit
- self.failUnlessRaises(OSError, Reference.create, rw_repo, full_ref)
+ self.failUnlessRaises(OSError, Reference.create, rw_repo, full_ref, 'HEAD~20')
+ # it works if it is at the same spot though and points to the same reference
+ assert Reference.create(rw_repo, full_ref, 'HEAD').path == full_ref
Reference.delete(rw_repo, full_ref)
# recreate the reference using a full_ref
@@ -279,7 +281,9 @@ class TestRefs(TestBase):
assert symref.path == symref_path
assert symref.reference == cur_head.reference
- self.failUnlessRaises(OSError, SymbolicReference.create, rw_repo, symref_path, cur_head.reference)
+ self.failUnlessRaises(OSError, SymbolicReference.create, rw_repo, symref_path, cur_head.reference.commit)
+ # it works if the new ref points to the same reference
+ SymbolicReference.create(rw_repo, symref.path, symref.reference).path == symref.path
SymbolicReference.delete(rw_repo, symref)
# would raise if the symref wouldn't have been deletedpbl
symref = SymbolicReference.create(rw_repo, symref_path, cur_head.reference)