Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5a75ab

Browse files
committed
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
1 parentb7071ce commita5a75ab

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎git/refs/symbolic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def __repr__(self):
4646
return'<git.%s "%s">'% (self.__class__.__name__,self.path)
4747

4848
def__eq__(self,other):
49-
returnself.path==other.path
49+
ifhasattr(other,'path'):
50+
returnself.path==other.path
51+
returnFalse
5052

5153
def__ne__(self,other):
5254
returnnot (self==other )

‎git/test/test_refs.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ def test_head_reset(self, rw_repo):
290290
assertremotes
291291
forremoteinremotes:
292292
refs=remote.refs
293+
294+
# If a HEAD exists, it must be deleted first. Otherwise it might
295+
# end up pointing to an invalid ref it the ref was deleted before.
296+
remote_head_name="HEAD"
297+
ifremote_head_nameinrefs:
298+
RemoteReference.delete(rw_repo,refs[remote_head_name])
299+
del(refs[remote_head_name])
300+
#END handle HEAD deletion
301+
293302
RemoteReference.delete(rw_repo,*refs)
294303
remote_refs_so_far+=len(refs)
295304
forrefinrefs:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp