mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
allow hard resetting to upstream branch
This commit is contained in:
@ -265,7 +265,7 @@ func includesInt(list []int, a int) bool {
|
||||
|
||||
// ResetAndClean removes all unstaged changes and removes all untracked files
|
||||
func (c *GitCommand) ResetAndClean() error {
|
||||
if err := c.ResetHardHead(); err != nil {
|
||||
if err := c.ResetHard("HEAD"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -961,14 +961,14 @@ func (c *GitCommand) RemoveUntrackedFiles() error {
|
||||
return c.OSCommand.RunCommand("git clean -fd")
|
||||
}
|
||||
|
||||
// ResetHardHead runs `git reset --hard HEAD`
|
||||
func (c *GitCommand) ResetHardHead() error {
|
||||
return c.OSCommand.RunCommand("git reset --hard HEAD")
|
||||
// ResetHardHead runs `git reset --hard`
|
||||
func (c *GitCommand) ResetHard(ref string) error {
|
||||
return c.OSCommand.RunCommand("git reset --hard " + ref)
|
||||
}
|
||||
|
||||
// ResetSoftHead runs `git reset --soft HEAD`
|
||||
func (c *GitCommand) ResetSoftHead() error {
|
||||
return c.OSCommand.RunCommand("git reset --soft HEAD")
|
||||
// ResetSoft runs `git reset --soft HEAD`
|
||||
func (c *GitCommand) ResetSoft(ref string) error {
|
||||
return c.OSCommand.RunCommand("git reset --soft " + ref)
|
||||
}
|
||||
|
||||
// DiffCommits show diff between commits
|
||||
|
Reference in New Issue
Block a user