mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Commit only tracked files in tracked only filter view
This commit is contained in:
committed by
Stefan Haller
parent
220f06052a
commit
7a1b63182d
@ -34,11 +34,15 @@ func (self *WorkingTreeCommands) OpenMergeToolCmdObj() oscommands.ICmdObj {
|
||||
|
||||
// StageFile stages a file
|
||||
func (self *WorkingTreeCommands) StageFile(path string) error {
|
||||
return self.StageFiles([]string{path})
|
||||
return self.StageFiles([]string{path}, nil)
|
||||
}
|
||||
|
||||
func (self *WorkingTreeCommands) StageFiles(paths []string) error {
|
||||
cmdArgs := NewGitCmd("add").Arg("--").Arg(paths...).ToArgv()
|
||||
func (self *WorkingTreeCommands) StageFiles(paths []string, extraArgs []string) error {
|
||||
cmdArgs := NewGitCmd("add").
|
||||
Arg(extraArgs...).
|
||||
Arg("--").
|
||||
Arg(paths...).
|
||||
ToArgv()
|
||||
|
||||
return self.cmd.New(cmdArgs).Run()
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ func TestWorkingTreeStageFiles(t *testing.T) {
|
||||
|
||||
instance := buildWorkingTreeCommands(commonDeps{runner: runner})
|
||||
|
||||
assert.NoError(t, instance.StageFiles([]string{"test.txt", "test2.txt"}))
|
||||
assert.NoError(t, instance.StageFiles([]string{"test.txt", "test2.txt"}, nil))
|
||||
runner.CheckForMissingCalls()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user