1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

fix ignore feature

This commit is contained in:
Jesse Duffield
2018-08-19 20:41:04 +10:00
parent 51558f51ab
commit aa4d739577
3 changed files with 16 additions and 5 deletions

View File

@ -461,10 +461,8 @@ func (c *GitCommand) GetLog() string {
}
// Ignore adds a file to the gitignore for the repo
func (c *GitCommand) Ignore(filename string) {
if _, err := c.OSCommand.RunDirectCommand("echo '" + filename + "' >> .gitignore"); err != nil {
panic(err)
}
func (c *GitCommand) Ignore(filename string) error {
return c.OSCommand.AppendLineToFile(".gitignore", filename)
}
// Show shows the diff of a commit