From 4e729429631c84c3bd5602edcab3e7c2ab1dcce0 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 3 Dec 2009 22:40:25 +0100 Subject: 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 --- test/git/test_refs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.1