Skip to content

Commit c334167

Browse files
committed
fix(worktree): align with Git's gitdir resolution
Git only normalizes relative references in `gitdir`[1], so do the same. [1]: https://github.com/git/git/blob/v2.54.0/setup.c#L1012-L1025
1 parent 7b83f7a commit c334167

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git/repo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def __init__(
295295
sm_gitpath = find_worktree_git_dir(dotgit)
296296

297297
if sm_gitpath is not None:
298-
git_dir = expand_path(sm_gitpath, expand_vars)
298+
git_dir = osp.normpath(sm_gitpath)
299299
self._working_tree_dir = curpath
300300
break
301301

0 commit comments

Comments
 (0)