diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-22 17:17:08 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 30a555b108ddf85d53ea26013e590027660ac5da (patch) | |
tree | 6f44fb3df3d943307eedf99bf9a822bbdedfcf4f /pkg/commands/patch | |
parent | 8be970e6880c00afd65ed83da3c92a7131756af5 (diff) |
don't needlessly load every file
Diffstat (limited to 'pkg/commands/patch')
-rw-r--r-- | pkg/commands/patch/patch_manager.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/commands/patch/patch_manager.go b/pkg/commands/patch/patch_manager.go index 0448b6c09..31eaf386b 100644 --- a/pkg/commands/patch/patch_manager.go +++ b/pkg/commands/patch/patch_manager.go @@ -211,13 +211,13 @@ func (p *PatchManager) RenderAggregatedPatchColored(plain bool) string { return result } -func (p *PatchManager) GetFileStatus(filename string) (int, error) { - info, err := p.getFileInfo(filename) - if err != nil { - return 0, err +func (p *PatchManager) GetFileStatus(filename string) int { + info, ok := p.fileInfoMap[filename] + if !ok { + return UNSELECTED } - return info.mode, nil + return info.mode } func (p *PatchManager) GetFileIncLineIndices(filename string) ([]int, error) { |