summaryrefslogtreecommitdiffstats
path: root/pkg/commands/patch
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 17:17:08 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit30a555b108ddf85d53ea26013e590027660ac5da (patch)
tree6f44fb3df3d943307eedf99bf9a822bbdedfcf4f /pkg/commands/patch
parent8be970e6880c00afd65ed83da3c92a7131756af5 (diff)
don't needlessly load every file
Diffstat (limited to 'pkg/commands/patch')
-rw-r--r--pkg/commands/patch/patch_manager.go10
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) {