1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Basic file for getting the fix working

This commit is contained in:
mjarkk
2018-10-17 20:38:13 +02:00
parent 1d733f3adc
commit cecd5733a8
2 changed files with 99 additions and 1 deletions

View File

@ -339,7 +339,17 @@ func (c *GitCommand) Push(branchName string, force bool) error {
forceFlag = "--force-with-lease "
}
return c.OSCommand.RunCommand(fmt.Sprintf("git push %s -u origin %s", forceFlag, branchName))
cmd := fmt.Sprintf("git push %s -u origin %s", forceFlag, branchName)
return c.OSCommand.DetectUnamePass(cmd, func(passOrUname string) string {
if passOrUname == "password" {
return "some password"
// ask for password
}
if passOrUname == "username" {
// ask for username
}
return ""
})
}
// SquashPreviousTwoCommits squashes a commit down to the one below it