1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

fix could-not-access error

This commit is contained in:
Jesse Duffield
2022-11-11 12:16:38 +11:00
parent ab03cf8bcf
commit e8b97c9fe2
22 changed files with 80 additions and 1 deletions

View File

@@ -241,7 +241,7 @@ func (self *WorkingTreeCommands) WorktreeFileDiffCmdObj(node models.IFile, plain
if cached {
cachedArg = " --cached"
}
if !node.GetIsTracked() && !node.GetHasStagedChanges() && !cached {
if !node.GetIsTracked() && !node.GetHasStagedChanges() && !cached && node.GetIsFile() {
trackedArg = "--no-index -- /dev/null"
}
if plain {

View File

@@ -29,6 +29,7 @@ type IFile interface {
GetIsTracked() bool
GetPath() string
GetPreviousPath() string
GetIsFile() bool
}
func (f *File) IsRename() bool {
@@ -92,6 +93,10 @@ func (f *File) GetPreviousPath() string {
return f.PreviousName
}
func (f *File) GetIsFile() bool {
return true
}
type StatusFields struct {
HasStagedChanges bool
HasUnstagedChanges bool