From a5a75ab7533de99a4f569b05535061581cb07a41 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 8 Jun 2011 11:24:10 +0200 Subject: relaxed implementation when comparing symbolic references against other items which don't have a path. Fixed test_refs to work in all cases - it was previously dependent on the order of items returned by the file system --- git/test/test_refs.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'git/test/test_refs.py') diff --git a/git/test/test_refs.py b/git/test/test_refs.py index f0473871..092861da 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -290,6 +290,15 @@ class TestRefs(TestBase): assert remotes for remote in remotes: refs = remote.refs + + # If a HEAD exists, it must be deleted first. Otherwise it might + # end up pointing to an invalid ref it the ref was deleted before. + remote_head_name = "HEAD" + if remote_head_name in refs: + RemoteReference.delete(rw_repo, refs[remote_head_name]) + del(refs[remote_head_name]) + #END handle HEAD deletion + RemoteReference.delete(rw_repo, *refs) remote_refs_so_far += len(refs) for ref in refs: -- cgit v1.2.1