1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

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

@ -629,9 +629,11 @@ func (self *BranchesController) fastForward(branch *models.Branch) error {
self.c.LogAction(action)
worktreeGitDir := ""
worktreePath := ""
// if it is the current worktree path, no need to specify the path
if !worktree.IsCurrent {
worktreeGitDir = worktree.GitDir
worktreePath = worktree.Path
}
err := self.c.Git().Sync.Pull(
@ -641,6 +643,7 @@ func (self *BranchesController) fastForward(branch *models.Branch) error {
BranchName: branch.UpstreamBranch,
FastForwardOnly: true,
WorktreeGitDir: worktreeGitDir,
WorktreePath: worktreePath,
},
)
_ = self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC})