From 2376bd397f084902196a929171c7f7869529bffc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 19 May 2016 13:09:51 +0200 Subject: Clarify costs of certain properties Fixes #428 --- git/repo/base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git/repo/base.py b/git/repo/base.py index 0274c0a7..e115fd4b 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -254,7 +254,9 @@ class Repo(object): @property def index(self): - """:return: IndexFile representing this repository's index.""" + """:return: IndexFile representing this repository's index. + :note: This property can be expensive, as the returned ``IndexFile`` will be + reinitialized. It's recommended to re-use the object.""" return IndexFile(self) @property @@ -624,7 +626,10 @@ class Repo(object): are relative to the current working directory of the git command. :note: - ignored files will not appear here, i.e. files mentioned in .gitignore""" + ignored files will not appear here, i.e. files mentioned in .gitignore + :note: + This property is expensive, as no cache is involved. To process the result, please + consider caching it yourself.""" return self._get_untracked_files() def _get_untracked_files(self, **kwargs): -- cgit v1.2.1