summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 17:26:23 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit2eee079d3aafb7914947e85fe5decd528c34ab93 (patch)
tree7570fd5cdfb1aa0a3b4c4d6cbdf4c7f4a9472db0 /pkg/commands
parent30a555b108ddf85d53ea26013e590027660ac5da (diff)
minor rename
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go8
-rw-r--r--pkg/commands/git_test.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 3a38bce13..868ca0a50 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -758,14 +758,14 @@ func (c *GitCommand) CheckRemoteBranchExists(branch *Branch) bool {
return err == nil
}
-// Diff returns the diff of a file
-func (c *GitCommand) Diff(file *File, plain bool, cached bool) string {
+// WorktreeFileDiff returns the diff of a file
+func (c *GitCommand) WorktreeFileDiff(file *File, plain bool, cached bool) string {
// for now we assume an error means the file was deleted
- s, _ := c.OSCommand.RunCommandWithOutput(c.DiffCmdStr(file, plain, cached))
+ s, _ := c.OSCommand.RunCommandWithOutput(c.WorktreeFileDiffCmdStr(file, plain, cached))
return s
}
-func (c *GitCommand) DiffCmdStr(file *File, plain bool, cached bool) string {
+func (c *GitCommand) WorktreeFileDiffCmdStr(file *File, plain bool, cached bool) string {
cachedArg := ""
trackedArg := "--"
colorArg := c.colorArg()
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go
index 7a892eec8..a4dbe3bde 100644
--- a/pkg/commands/git_test.go
+++ b/pkg/commands/git_test.go
@@ -1474,7 +1474,7 @@ func TestGitCommandDiff(t *testing.T) {
t.Run(s.testName, func(t *testing.T) {
gitCmd := NewDummyGitCommand()
gitCmd.OSCommand.command = s.command
- gitCmd.Diff(s.file, s.plain, s.cached)
+ gitCmd.WorktreeFileDiff(s.file, s.plain, s.cached)
})
}
}