mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-14 11:02:27 +03:00
Support fastforwarding worktree
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package git_commands
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// convenience struct for building git commands. Especially useful when
|
||||
// including conditional args
|
||||
@ -66,6 +68,14 @@ func (self *GitCommandBuilder) GitDir(path string) *GitCommandBuilder {
|
||||
return self
|
||||
}
|
||||
|
||||
func (self *GitCommandBuilder) GitDirIf(condition bool, path string) *GitCommandBuilder {
|
||||
if condition {
|
||||
return self.GitDir(path)
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
|
||||
func (self *GitCommandBuilder) ToArgv() []string {
|
||||
return append([]string{"git"}, self.args...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user