Skip to content

Commit ede325d

Browse files
committed
Removed all previously added invocations of os.path.realpath as it wasn't required afterall.
Turns out that the now removed `read_gitfile` functions applied os.path.realpath which caused the issue described in #224. Fixes #224
1 parent 43e430d commit ede325d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

git/index/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ def _to_relative_path(self, path):
535535
if it is not within our git direcotory"""
536536
if not os.path.isabs(path):
537537
return path
538-
path = os.path.realpath(path)
539538
relative_path = path.replace(self.repo.working_tree_dir + os.sep, "")
540539
if relative_path == path:
541540
raise ValueError("Absolute path %r is not in git repository at %r" % (path, self.repo.working_tree_dir))

git/repo/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals
128128
# walk up the path to find the .git dir
129129
while curpath:
130130
if is_git_dir(curpath):
131-
self.git_dir = os.path.realpath(curpath)
131+
self.git_dir = curpath
132132
self._working_tree_dir = os.path.dirname(self.git_dir)
133133
break
134134

135135
gitpath = find_git_dir(join(curpath, '.git'))
136136
if gitpath is not None:
137-
self.git_dir = os.path.realpath(gitpath)
138-
self._working_tree_dir = os.path.realpath(curpath)
137+
self.git_dir = gitpath
138+
self._working_tree_dir = curpath
139139
break
140140

141141
if not search_parent_directories:

0 commit comments

Comments
 (0)