summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-26 21:12:12 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-26 21:44:33 +1100
commit21b7d4184535e1132c828c379c7125ecd100e02a (patch)
tree9b4741429f017fb529bab826a4b5455771d379d6 /pkg/commands
parent91a404d0331132d3aac463a4e77a7c73b81c5961 (diff)
relax limit on commit list and reset on branch change
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/commit_list_builder.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/pkg/commands/commit_list_builder.go b/pkg/commands/commit_list_builder.go
index 7f7a979b5..a39ab7593 100644
--- a/pkg/commands/commit_list_builder.go
+++ b/pkg/commands/commit_list_builder.go
@@ -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))
}