mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-27 05:01:50 +03:00
Add worktree integration tests
This commit is contained in:
@ -108,6 +108,8 @@ func CheckedOutByOtherWorktree(branch *models.Branch, worktrees []*models.Worktr
|
||||
return !IsCurrentWorktree(worktree.Path)
|
||||
}
|
||||
|
||||
// If in a non-bare repo, this returns the path of the main worktree
|
||||
// TODO: see if this works with a bare repo.
|
||||
func GetCurrentRepoPath() string {
|
||||
pwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
@ -128,7 +130,7 @@ func GetCurrentRepoPath() string {
|
||||
}
|
||||
|
||||
// either in a submodule, a worktree, or a bare repo
|
||||
worktreeGitPath, ok := WorktreeGitPath(pwd)
|
||||
worktreeGitPath, ok := LinkedWorktreeGitPath(pwd)
|
||||
if !ok {
|
||||
// fallback
|
||||
return currentPath()
|
||||
|
Reference in New Issue
Block a user