Skip to content

Commit 2376bd3

Browse files
committed
Clarify costs of certain properties
Fixes #428
1 parent 4bcc4d5 commit 2376bd3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git/repo/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ def references(self):
254254

255255
@property
256256
def index(self):
257-
""":return: IndexFile representing this repository's index."""
257+
""":return: IndexFile representing this repository's index.
258+
:note: This property can be expensive, as the returned ``IndexFile`` will be
259+
reinitialized. It's recommended to re-use the object."""
258260
return IndexFile(self)
259261

260262
@property
@@ -624,7 +626,10 @@ def untracked_files(self):
624626
are relative to the current working directory of the git command.
625627
626628
:note:
627-
ignored files will not appear here, i.e. files mentioned in .gitignore"""
629+
ignored files will not appear here, i.e. files mentioned in .gitignore
630+
:note:
631+
This property is expensive, as no cache is involved. To process the result, please
632+
consider caching it yourself."""
628633
return self._get_untracked_files()
629634

630635
def _get_untracked_files(self, **kwargs):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy