From 5ebab5d5ec1b3afbf5d941d3a87fa16eb6d2fbe0 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 31 Aug 2016 08:34:54 +0200 Subject: [PATCH] Fix commit count with git version < 1.8.0 With format='' the output does not end with a newline (checked) --- commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.go b/commit.go index adde7ed..f5274cd 100644 --- a/commit.go +++ b/commit.go @@ -142,7 +142,7 @@ func commitsCount(repoPath, revision, relpath string) (int64, error) { } if isFallback { - return int64(strings.Count(stdout, "\n")), nil + return int64(strings.Count(stdout, "\n")) + 1, nil } return strconv.ParseInt(strings.TrimSpace(stdout), 10, 64) }