mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-12 23:41:54 +03:00
commands/git : add test to Push func, refactor
This commit is contained in:
@ -304,13 +304,15 @@ func (c *GitCommand) Pull() error {
|
||||
return c.OSCommand.RunCommand("git pull --no-edit")
|
||||
}
|
||||
|
||||
// Push push to a branch
|
||||
// Push pushes to a branch
|
||||
func (c *GitCommand) Push(branchName string, force bool) error {
|
||||
forceFlag := ""
|
||||
|
||||
if force {
|
||||
forceFlag = "--force-with-lease "
|
||||
}
|
||||
return c.OSCommand.RunCommand("git push " + forceFlag + "-u origin " + branchName)
|
||||
|
||||
return c.OSCommand.RunCommand(fmt.Sprintf("git push %s -u origin %s", forceFlag, branchName))
|
||||
}
|
||||
|
||||
// SquashPreviousTwoCommits squashes a commit down to the one below it
|
||||
|
Reference in New Issue
Block a user