Skip to content

Commit a7872d4

Browse files
committed
Fix GetCommitsInfo for repository with only one commit.
Signed-off-by: Filip Navara <[email protected]>
1 parent fb3d4f7 commit a7872d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/git/commit_info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,10 @@ func getLastCommitForPaths(c *object.Commit, treePath string, paths []string) ([
162162
return nil
163163
})
164164

165+
// only one commit in the repository
166+
if resultTree == nil {
167+
resultTree = c
168+
}
169+
165170
return result, resultTree, nil
166171
}

0 commit comments

Comments
 (0)