mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Support fastforwarding worktree
This commit is contained in:
parent
a313b16704
commit
b3060065d9
6 changed files with 107 additions and 4 deletions
|
@ -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...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue