1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

commands/git : reverse the logic

This commit is contained in:
Anthony HAMON
2018-09-18 09:23:41 +02:00
parent 6f0b32f95e
commit 60cf549a32

View File

@ -484,14 +484,15 @@ func (c *GitCommand) GetCommits() []Commit {
func (c *GitCommand) GetLog() string { func (c *GitCommand) GetLog() string {
// currently limiting to 30 for performance reasons // currently limiting to 30 for performance reasons
// TODO: add lazyloading when you scroll down // TODO: add lazyloading when you scroll down
if result, err := c.OSCommand.RunCommandWithOutput("git log --oneline -30"); err == nil { result, err := c.OSCommand.RunCommandWithOutput("git log --oneline -30")
return result if err != nil {
}
// assume if there is an error there are no commits yet for this branch // assume if there is an error there are no commits yet for this branch
return "" return ""
} }
return result
}
// Ignore adds a file to the gitignore for the repo // Ignore adds a file to the gitignore for the repo
func (c *GitCommand) Ignore(filename string) error { func (c *GitCommand) Ignore(filename string) error {
return c.OSCommand.AppendLineToFile(".gitignore", filename) return c.OSCommand.AppendLineToFile(".gitignore", filename)