File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
// Commits returns a set of commits.
12
12
// If commitrange is a git still range 12345...54321, then it will be isolated set of commits.
13
13
// If commitrange is a single commit, all ancestor commits up through the hash provided.
14
+ // If commitrange is an empty commit range, then nil is returned.
14
15
func Commits (commitrange string ) ([]CommitEntry , error ) {
15
16
cmdArgs := []string {"git" , "log" , `--pretty=format:%H` , commitrange }
16
17
if debug () {
@@ -20,6 +21,9 @@ func Commits(commitrange string) ([]CommitEntry, error) {
20
21
if err != nil {
21
22
return nil , err
22
23
}
24
+ if len (output ) == 0 {
25
+ return nil , nil
26
+ }
23
27
commitHashes := strings .Split (strings .TrimSpace (string (output )), "\n " )
24
28
commits := make ([]CommitEntry , len (commitHashes ))
25
29
for i , commitHash := range commitHashes {
You can’t perform that action at this time.
0 commit comments