summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorGlenn Vriesman <glenn.vriesman@gmail.com>2020-02-04 12:50:13 +0100
committerJesse Duffield <jessedduffield@gmail.com>2020-02-06 23:19:29 +1100
commit9f5397a2d46a6a444e8d157c91fee5909006c63d (patch)
tree8640df19dd7f5f238293656322a449e58f6b2ade /pkg/commands
parent0164abbd4a5c7206b5980d65aff1f9fa7fc3e188 (diff)
Moved function to git.go
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index adf304acd..ca0c83501 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -940,6 +940,11 @@ func (c *GitCommand) DiscardAnyUnstagedFileChanges() error {
return c.OSCommand.RunCommand("git checkout -- .")
}
+// RemoveTrackedFiles will delete the given file(s) even if they are currently tracked
+func (c *GitCommand) RemoveTrackedFiles(name string) error {
+ return c.OSCommand.RunCommand("git rm -r --cached %s", name)
+}
+
// RemoveUntrackedFiles runs `git clean -fd`
func (c *GitCommand) RemoveUntrackedFiles() error {
return c.OSCommand.RunCommand("git clean -fd")