mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Support setting the similarity threshold for detecting renames
This commit is contained in:
parent
bfe2dd4ed8
commit
b9107d5fc8
26 changed files with 909 additions and 618 deletions
|
@ -100,15 +100,19 @@ type FileStatus struct {
|
|||
PreviousName string
|
||||
}
|
||||
|
||||
func (c *FileLoader) gitStatus(opts GitStatusOptions) ([]FileStatus, error) {
|
||||
func (self *FileLoader) gitStatus(opts GitStatusOptions) ([]FileStatus, error) {
|
||||
cmdArgs := NewGitCmd("status").
|
||||
Arg(opts.UntrackedFilesArg).
|
||||
Arg("--porcelain").
|
||||
Arg("-z").
|
||||
ArgIf(opts.NoRenames, "--no-renames").
|
||||
ArgIfElse(
|
||||
opts.NoRenames,
|
||||
"--no-renames",
|
||||
fmt.Sprintf("--find-renames=%d%%", self.AppState.RenameSimilarityThreshold),
|
||||
).
|
||||
ToArgv()
|
||||
|
||||
statusLines, _, err := c.cmd.New(cmdArgs).DontLog().RunWithOutputs()
|
||||
statusLines, _, err := self.cmd.New(cmdArgs).DontLog().RunWithOutputs()
|
||||
if err != nil {
|
||||
return []FileStatus{}, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue