summaryrefslogtreecommitdiff
path: root/test/git/test_refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-12-03 22:40:25 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-12-03 22:40:25 +0100
commit4e729429631c84c3bd5602edcab3e7c2ab1dcce0 (patch)
tree5adf9421a59f1f136d4b0a8b7450a56692ce7936 /test/git/test_refs.py
parent12276fedec49c855401262f0929f088ebf33d2cf (diff)
downloadgitpython-4e729429631c84c3bd5602edcab3e7c2ab1dcce0.tar.gz
refs.rename: improved handling as it will only raise ( if not forced ) if the destination contains different data. If it contains the same, the move will work as we can do what the user intended
Diffstat (limited to 'test/git/test_refs.py')
-rw-r--r--test/git/test_refs.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/git/test_refs.py b/test/git/test_refs.py
index aee9b706..762554dc 100644
--- a/test/git/test_refs.py
+++ b/test/git/test_refs.py
@@ -267,7 +267,10 @@ class TestRefs(TestBase):
# exists, fail unless we force
ex_ref_path = far_away_head.path
self.failUnlessRaises(OSError, ref.rename, ex_ref_path)
- assert ref.rename(ex_ref_path, force=True).path == ex_ref_path and ref.object == orig_obj
+ # if it points to the same commit it works
+ far_away_head.commit = ref.commit
+ ref.rename(ex_ref_path)
+ assert ref.path == ex_ref_path and ref.object == orig_obj
assert ref.rename(ref.path).path == ex_ref_path # rename to same name
# create symbolic refs