Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scmrepo/git/backend/dulwich/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def scandir(self) -> Iterable["DulwichObject"]:
self.repo, entry.path.decode(), entry.mode, entry.sha
)

@property
def size(self) -> int:
@cached_property
def size(self) -> int: # pylint: disable=invalid-overridden-method
return len(self.repo[self.sha].as_raw_string())

@property
Expand Down
4 changes: 2 additions & 2 deletions scmrepo/git/backend/pygit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def mode(self):
return stat.S_IFDIR
return self.obj.filemode

@property
def size(self) -> int:
@cached_property
def size(self) -> int: # pylint: disable=invalid-overridden-method
try:
return len(self.obj.read_raw())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welp, actually there is size, but just not for trees. Will send a followup.

except KeyError:
Expand Down