1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

minor rename

This commit is contained in:
Jesse Duffield
2020-08-22 17:26:23 +10:00
parent 30a555b108
commit 2eee079d3a
4 changed files with 9 additions and 9 deletions

View File

@ -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()

View File

@ -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)
})
}
}