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

relax limit on commit list and reset on branch change

This commit is contained in:
Jesse Duffield
2020-03-26 21:12:12 +11:00
parent 91a404d033
commit 21b7d41845
4 changed files with 19 additions and 15 deletions

View File

@ -299,18 +299,11 @@ func (c *CommitListBuilder) getUnpushedCommits() map[string]bool {
}
// getLog gets the git log.
func (c *CommitListBuilder) getLog(limit bool) string {
func (c *CommitListBuilder) getLogCmd(limit bool) *exec.Cmd {
limitFlag := ""
if limit {
limitFlag = "-30"
limitFlag = "-300"
}
result, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("git log --oneline --pretty=format:\"%%H%s%%ar%s%%aN%s%%d%s%%s\" %s --abbrev=%d", SEPARATION_CHAR, SEPARATION_CHAR, SEPARATION_CHAR, SEPARATION_CHAR, limitFlag, 20))
if err != nil {
// assume if there is an error there are no commits yet for this branch
return ""
}
return result
return c.OSCommand.ExecutableFromString(fmt.Sprintf("git log --oneline --pretty=format:\"%%H%s%%ar%s%%aN%s%%d%s%%s\" %s --abbrev=%d", SEPARATION_CHAR, SEPARATION_CHAR, SEPARATION_CHAR, SEPARATION_CHAR, limitFlag, 20))
}