Skip to content

Commit 5ebab5d

Browse files
committed
Fix commit count with git version < 1.8.0
With format='' the output does not end with a newline (checked)
1 parent 424b048 commit 5ebab5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func commitsCount(repoPath, revision, relpath string) (int64, error) {
142142
}
143143

144144
if isFallback {
145-
return int64(strings.Count(stdout, "\n")), nil
145+
return int64(strings.Count(stdout, "\n")) + 1, nil
146146
}
147147
return strconv.ParseInt(strings.TrimSpace(stdout), 10, 64)
148148
}

0 commit comments

Comments
 (0)