diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-19 20:41:04 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-19 20:41:04 +1000 |
commit | aa4d739577f627ca6a3843ccb9e9468c7dd7aeba (patch) | |
tree | 739ea69769d7e644f17222bf44b05c74ccfd4438 /pkg/commands/git.go | |
parent | 51558f51ab3b54b445f7449582a060f1bc42de18 (diff) |
fix ignore feature
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 5176e55c9..557e6a8c0 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -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 |