1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-05 23:18:28 +02:00

Use DiffContextSize in WorkTreeFileDiffCmdStr

This commit is contained in:
DerTeta
2021-08-11 22:33:29 +02:00
committed by Jesse Duffield
parent 9feaf5d70f
commit ca88620e8f
2 changed files with 32 additions and 6 deletions

View File

@@ -207,6 +207,7 @@ func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFile, plain bool, cache
colorArg := c.colorArg()
quotedPath := c.OSCommand.Quote(node.GetPath())
ignoreWhitespaceArg := ""
contextSize := c.Config.GetUserConfig().Git.DiffContextSize
if cached {
cachedArg = "--cached"
}
@@ -220,7 +221,7 @@ func (c *GitCommand) WorktreeFileDiffCmdStr(node models.IFile, plain bool, cache
ignoreWhitespaceArg = "--ignore-all-space"
}
return fmt.Sprintf("git diff --submodule --no-ext-diff --color=%s %s %s %s %s", colorArg, ignoreWhitespaceArg, cachedArg, trackedArg, quotedPath)
return fmt.Sprintf("git diff --submodule --no-ext-diff --unified=%d --color=%s %s %s %s %s", contextSize, colorArg, ignoreWhitespaceArg, cachedArg, trackedArg, quotedPath)
}
func (c *GitCommand) ApplyPatch(patch string, flags ...string) error {