mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-26 09:00:57 +02:00
Moved function to git.go
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
This commit is contained in:
parent
0164abbd4a
commit
9f5397a2d4
@ -940,6 +940,11 @@ func (c *GitCommand) DiscardAnyUnstagedFileChanges() error {
|
|||||||
return c.OSCommand.RunCommand("git checkout -- .")
|
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`
|
// RemoveUntrackedFiles runs `git clean -fd`
|
||||||
func (c *GitCommand) RemoveUntrackedFiles() error {
|
func (c *GitCommand) RemoveUntrackedFiles() error {
|
||||||
return c.OSCommand.RunCommand("git clean -fd")
|
return c.OSCommand.RunCommand("git clean -fd")
|
||||||
|
@ -254,7 +254,7 @@ func (gui *Gui) handleIgnoreFile(g *gocui.Gui, v *gocui.View) error {
|
|||||||
if err := gui.GitCommand.Ignore(file.Name); err != nil {
|
if err := gui.GitCommand.Ignore(file.Name); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := gui.GitCommand.OSCommand.RunCommand("git rm -r --cached %s", file.Name); err != nil {
|
if err := gui.GitCommand.RemoveTrackedFiles(file.Name); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return gui.refreshFiles()
|
return gui.refreshFiles()
|
||||||
|
Loading…
Reference in New Issue
Block a user