mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
Added rebase support commands
This commit is contained in:
committed by
Jesse Duffield
parent
34fd18a395
commit
7a7e885773
@ -269,6 +269,10 @@ func (c *GitCommand) RebaseBranch(onto string) error {
|
|||||||
return c.OSCommand.RunCommand(fmt.Sprintf("git rebase %s %s ", onto, curBranch))
|
return c.OSCommand.RunCommand(fmt.Sprintf("git rebase %s %s ", onto, curBranch))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *GitCommand) ContinueRebaseBranch() error {
|
||||||
|
return c.OSCommand.RunCommand("git rebase --continue")
|
||||||
|
}
|
||||||
|
|
||||||
func (c *GitCommand) AbortRebaseBranch() error {
|
func (c *GitCommand) AbortRebaseBranch() error {
|
||||||
return c.OSCommand.RunCommand("git rebase --abort")
|
return c.OSCommand.RunCommand("git rebase --abort")
|
||||||
}
|
}
|
||||||
@ -450,6 +454,14 @@ func (c *GitCommand) IsInMergeState() (bool, error) {
|
|||||||
return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil
|
return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *GitCommand) IsInRebaseState() (bool, error) {
|
||||||
|
output, err := c.OSCommand.RunCommandWithOutput("git status --untracked-files=all")
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return strings.Contains(output, "rebase in progress"), nil
|
||||||
|
}
|
||||||
|
|
||||||
// RemoveFile directly
|
// RemoveFile directly
|
||||||
func (c *GitCommand) RemoveFile(file *File) error {
|
func (c *GitCommand) RemoveFile(file *File) error {
|
||||||
// if the file isn't tracked, we assume you want to delete it
|
// if the file isn't tracked, we assume you want to delete it
|
||||||
|
Reference in New Issue
Block a user