mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Move current worktree to top of list
This commit is contained in:
@ -33,12 +33,16 @@ func (self *WorktreeCommands) Delete(worktreePath string, force bool) error {
|
||||
}
|
||||
|
||||
func (self *WorktreeCommands) IsCurrentWorktree(w *models.Worktree) bool {
|
||||
return IsCurrentWorktree(w)
|
||||
}
|
||||
|
||||
func IsCurrentWorktree(w *models.Worktree) bool {
|
||||
pwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatalln(err.Error())
|
||||
}
|
||||
|
||||
return pwd == w.Path
|
||||
return EqualPath(pwd, w.Path)
|
||||
}
|
||||
|
||||
func (self *WorktreeCommands) IsWorktreePathMissing(w *models.Worktree) bool {
|
||||
@ -50,3 +54,9 @@ func (self *WorktreeCommands) IsWorktreePathMissing(w *models.Worktree) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// checks if two paths are equal
|
||||
// TODO: support relative paths
|
||||
func EqualPath(a string, b string) bool {
|
||||
return a == b
|
||||
}
|
||||
|
Reference in New Issue
Block a user