diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-23 11:07:04 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-23 11:07:04 +0200 |
commit | 3d3a24b22d340c62fafc0e75a349c0ffe34d99d7 (patch) | |
tree | f4487593b2b67b5c50b96dcb398a5cd0b3821ab0 /lib/git/index.py | |
parent | a10aa36bc6a82bd50df6f3df7d6b7ce04a7070f1 (diff) | |
download | gitpython-3d3a24b22d340c62fafc0e75a349c0ffe34d99d7.tar.gz |
Added repo.index property including simple test, and additional ideas in the TODO list
Diffstat (limited to 'lib/git/index.py')
-rw-r--r-- | lib/git/index.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/git/index.py b/lib/git/index.py index 5f13790c..5452708d 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -289,7 +289,8 @@ class IndexFile(LazyMixin, diff.Diffable): ``file_path`` If None, we will write to our stored file path from which we have been initialized. Otherwise we write to the given file path. - Please note that this will not change the file_path of this index. + Please note that this will change the file_path of this index to + the one you gave. Returns self @@ -319,7 +320,10 @@ class IndexFile(LazyMixin, diff.Diffable): # write the sha over the content stream.write_sha() write_op._end_writing() - + + # make sure we represent what we have written + if file_path is not None: + self._file_path = file_path @classmethod def from_tree(cls, repo, *treeish, **kwargs): |