mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Address PR comments
This commit is contained in:
committed by
Jesse Duffield
parent
1ce9a87544
commit
db02c13bf6
@ -1,11 +1,6 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/go-errors/errors"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
@ -35,22 +30,3 @@ func (w *Worktree) Name() string {
|
||||
func (w *Worktree) Main() bool {
|
||||
return w.Id == 0
|
||||
}
|
||||
|
||||
func (w *Worktree) Current() bool {
|
||||
pwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatalln(err.Error())
|
||||
}
|
||||
|
||||
return pwd == w.Path
|
||||
}
|
||||
|
||||
func (w *Worktree) Missing() bool {
|
||||
if _, err := os.Stat(w.Path); err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return true
|
||||
}
|
||||
log.Fatalln(fmt.Errorf("failed to check if worktree path `%s` exists\n%w", w.Path, err).Error())
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user