summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-25 08:51:47 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-25 08:59:51 +1000
commit60422912c8d41628c5ed1b4dd9432694c1be9199 (patch)
treebc4c85c0291106b30ca1c8db541143ba3c7d4a45 /pkg/commands
parent6c389df57dacc1b65e1891c247b20a6d64f94702 (diff)
add 'a' keybinding to toggle staged/unstaged for all files
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 14f3a433a..ab4cebf87 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -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