Moved function to git.go

Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
This commit is contained in:
Glenn Vriesman 2020-02-04 12:50:13 +01:00 committed by Jesse Duffield
parent 0164abbd4a
commit 9f5397a2d4
2 changed files with 6 additions and 1 deletions

View file

@ -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")