mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-27 12:32:37 +02:00
allow entering a password when fast forwarding another branch
This commit is contained in:
parent
9c7e40906d
commit
2d18d089ce
@ -791,8 +791,9 @@ func (c *GitCommand) ApplyPatch(patch string, flags ...string) error {
|
|||||||
return c.OSCommand.RunCommand("git apply %s %s", flagStr, c.OSCommand.Quote(filepath))
|
return c.OSCommand.RunCommand("git apply %s %s", flagStr, c.OSCommand.Quote(filepath))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *GitCommand) FastForward(branchName string, remoteName string, remoteBranchName string) error {
|
func (c *GitCommand) FastForward(branchName string, remoteName string, remoteBranchName string, promptUserForCredential func(string) string) error {
|
||||||
return c.OSCommand.RunCommand("git fetch %s %s:%s", remoteName, remoteBranchName, branchName)
|
command := fmt.Sprintf("git fetch %s %s:%s", remoteName, remoteBranchName, branchName)
|
||||||
|
return c.OSCommand.DetectUnamePass(command, promptUserForCredential)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *GitCommand) RunSkipEditorCommand(command string) error {
|
func (c *GitCommand) RunSkipEditorCommand(command string) error {
|
||||||
|
@ -400,16 +400,11 @@ func (gui *Gui) handleFastForward(g *gocui.Gui, v *gocui.View) error {
|
|||||||
|
|
||||||
if gui.State.Panels.Branches.SelectedLine == 0 {
|
if gui.State.Panels.Branches.SelectedLine == 0 {
|
||||||
_ = gui.pullWithMode("ff-only", PullFilesOptions{})
|
_ = gui.pullWithMode("ff-only", PullFilesOptions{})
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
if err := gui.GitCommand.FastForward(branch.Name, remoteName, remoteBranchName); err != nil {
|
err := gui.GitCommand.FastForward(branch.Name, remoteName, remoteBranchName, gui.promptUserForCredential)
|
||||||
_ = gui.surfaceError(err)
|
gui.handleCredentialsPopup(err)
|
||||||
return
|
|
||||||
}
|
|
||||||
_ = gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{BRANCHES}})
|
_ = gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []int{BRANCHES}})
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = gui.closeConfirmationPrompt(gui.g, true)
|
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user