Add worktree option to fast forwarding operation

This commit is contained in:
John Mutuma 2024-11-08 15:40:07 +00:00 committed by Jesse Duffield
parent c4e59aea66
commit e1c18226bf
5 changed files with 73 additions and 0 deletions

View file

@ -76,6 +76,14 @@ func (self *GitCommandBuilder) Worktree(path string) *GitCommandBuilder {
return self
}
func (self *GitCommandBuilder) WorktreePathIf(condition bool, path string) *GitCommandBuilder {
if condition {
return self.Worktree(path)
}
return self
}
// Note, you may prefer to use the Dir method instead of this one
func (self *GitCommandBuilder) GitDir(path string) *GitCommandBuilder {
// git dir arg comes before the command