summaryrefslogtreecommitdiff
path: root/git/index/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-12 11:14:06 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-12 11:14:06 +0100
commit43e430d7fa5298f6db6b1649c1a77c208bacf2fc (patch)
treeed554025ee4366c76a318f50dfe48ac0783f28f1 /git/index/base.py
parentdfb0a9c4bca590efaa86f8edc3fdb62bd536bce7 (diff)
downloadgitpython-43e430d7fa5298f6db6b1649c1a77c208bacf2fc.tar.gz
Repo paths are now converted to real paths, as well as all paths involved in index related work.
That way, we don't try to compare a real-path to a non-real one, which would make the implementation think a file is not actually part of the repository. Fixes #224
Diffstat (limited to 'git/index/base.py')
-rw-r--r--git/index/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/git/index/base.py b/git/index/base.py
index 66fd5b1f..c6e57f13 100644
--- a/git/index/base.py
+++ b/git/index/base.py
@@ -535,6 +535,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
if it is not within our git direcotory"""
if not os.path.isabs(path):
return path
+ path = os.path.realpath(path)
relative_path = path.replace(self.repo.working_tree_dir + os.sep, "")
if relative_path == path:
raise ValueError("Absolute path %r is not in git repository at %r" % (path, self.repo.working_tree_dir))