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

Commitaf9e37c

Browse files
committed
IndexObjects are now checking their slots to raise a proper error message in case someone tries to access an unset path or mode - this information cannot be retrieved afterwards as IndexObject information is kept in the object that pointed at them. To find this information, one would have to search all objects which is not feasible
1 parent4c73e9c commitaf9e37c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎lib/git/objects/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,15 @@ def __init__(self, repo, id, mode=None, path=None):
120120
ifisinstance(mode,basestring):
121121
self.mode=self._mode_str_to_int(mode)
122122

123+
def_set_cache_(self,attr):
124+
ifattrinself.__slots__:
125+
# they cannot be retrieved lateron ( not without searching for them )
126+
raiseAttributeError("path and mode attributes must have been set during %s object creation"%type(self).__name__ )
127+
else:
128+
super(IndexObject,self)._set_cache_(attr)
129+
123130
@classmethod
124-
def_mode_str_to_int(cls,modestr):
131+
def_mode_str_to_int(cls,modestr):
125132
"""
126133
``modestr``
127134
string like 755 or 644 or 100644 - only the last 3 chars will be used

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp