add 'a' keybinding to toggle staged/unstaged for all files

This commit is contained in:
Jesse Duffield 2018-08-25 08:51:47 +10:00
parent 6c389df57d
commit 60422912c8
7 changed files with 52 additions and 2 deletions

View file

@ -7,9 +7,9 @@ import (
"os/exec"
"strings"
"github.com/sirupsen/logrus"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/sirupsen/logrus"
gitconfig "github.com/tcnksm/go-gitconfig"
gogit "gopkg.in/src-d/go-git.v4"
)
@ -340,6 +340,16 @@ func (c *GitCommand) StageFile(fileName string) error {
return c.OSCommand.RunCommand("git add " + c.OSCommand.Quote(fileName))
}
// StageAll stages all files
func (c *GitCommand) StageAll() error {
return c.OSCommand.RunCommand("git add -A")
}
// UnstageAll stages all files
func (c *GitCommand) UnstageAll() error {
return c.OSCommand.RunCommand("git reset")
}
// UnStageFile unstages a file
func (c *GitCommand) UnStageFile(fileName string, tracked bool) error {
var command string