summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-31 23:26:53 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-04-02 11:00:15 +1100
commit9e85d37fb949bbc83f28cb079f2ac4b45ae895ce (patch)
treebaec08e7f7616129d1a23a1834ac9146138efe87 /pkg/commands
parent8dee06f83a1aebe9eb085e67b790f166f9d205af (diff)
refactor to no longer call these things file changes
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/files.go10
-rw-r--r--pkg/commands/models/file.go2
2 files changed, 6 insertions, 6 deletions
diff --git a/pkg/commands/files.go b/pkg/commands/files.go
index 5443b7d04..3f6d1c377 100644
--- a/pkg/commands/files.go
+++ b/pkg/commands/files.go
@@ -138,12 +138,12 @@ func (c *GitCommand) DiscardAllFileChanges(file *models.File) error {
return c.DiscardUnstagedFileChanges(file)
}
-func (c *GitCommand) DiscardAllDirChanges(node *filetree.FileChangeNode) error {
+func (c *GitCommand) DiscardAllDirChanges(node *filetree.FileNode) error {
// this could be more efficient but we would need to handle all the edge cases
return node.ForEachFile(c.DiscardAllFileChanges)
}
-func (c *GitCommand) DiscardUnstagedDirChanges(node *filetree.FileChangeNode) error {
+func (c *GitCommand) DiscardUnstagedDirChanges(node *filetree.FileNode) error {
if err := c.RemoveUntrackedDirFiles(node); err != nil {
return err
}
@@ -156,9 +156,9 @@ func (c *GitCommand) DiscardUnstagedDirChanges(node *filetree.FileChangeNode) er
return nil
}
-func (c *GitCommand) RemoveUntrackedDirFiles(node *filetree.FileChangeNode) error {
+func (c *GitCommand) RemoveUntrackedDirFiles(node *filetree.FileNode) error {
untrackedFilePaths := node.GetPathsMatching(
- func(n *filetree.FileChangeNode) bool { return n.File != nil && !n.File.GetIsTracked() },
+ func(n *filetree.FileNode) bool { return n.File != nil && !n.File.GetIsTracked() },
)
for _, path := range untrackedFilePaths {
@@ -189,7 +189,7 @@ func (c *GitCommand) WorktreeFileDiff(file *models.File, plain bool, cached bool
return s
}
-func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFileChange, plain bool, cached bool) string {
+func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFile, plain bool, cached bool) string {
cachedArg := ""
trackedArg := "--"
colorArg := c.colorArg()
diff --git a/pkg/commands/models/file.go b/pkg/commands/models/file.go
index a02beae63..0bbca78ae 100644
--- a/pkg/commands/models/file.go
+++ b/pkg/commands/models/file.go
@@ -22,7 +22,7 @@ type File struct {
}
// sometimes we need to deal with either a node (which contains a file) or an actual file
-type IFileChange interface {
+type IFile interface {
GetHasUnstagedChanges() bool
GetHasStagedChanges() bool
GetIsTracked() bool