From 3d3a24b22d340c62fafc0e75a349c0ffe34d99d7 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 11:07:04 +0200 Subject: Added repo.index property including simple test, and additional ideas in the TODO list --- lib/git/index.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/git/index.py') 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): -- cgit v1.2.1