mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
Add worktree integration tests
This commit is contained in:
parent
18a508b29c
commit
277142fc4b
12 changed files with 385 additions and 18 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue