From ee308a49946633c0ba6d96e38aec99e0f88eac90 Mon Sep 17 00:00:00 2001 From: Cristian Betivu Date: Wed, 16 Aug 2023 21:13:28 +0300 Subject: [PATCH] Clean before convertion? --- pkg/commands/git_commands/repo_paths.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/commands/git_commands/repo_paths.go b/pkg/commands/git_commands/repo_paths.go index 8bae26258..e80b19a1c 100644 --- a/pkg/commands/git_commands/repo_paths.go +++ b/pkg/commands/git_commands/repo_paths.go @@ -158,6 +158,7 @@ func linkedWorktreeGitDirPath(fs afero.Fs, worktreePath string) (string, error) gitDir := strings.TrimPrefix(gitDirLine[0], "gitdir: ") + gitDir = filepath.Clean(gitDir) // For windows support gitDir = filepath.ToSlash(gitDir) @@ -208,7 +209,7 @@ func getCurrentRepoGitDirPath( } // confirm whether the next directory up is the worktrees directory - parent := path.Dir(path.Clean(worktreeGitPath)) + parent := path.Dir(worktreeGitPath) if path.Base(parent) == "worktrees" { gitDirPath := path.Dir(parent) return gitDirPath, path.Dir(gitDirPath), nil