mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
Fix getAllcommitIds bug in empty repository
This commit is contained in:
@@ -573,7 +573,9 @@ object JGitUtil {
|
|||||||
/**
|
/**
|
||||||
* Returns all commit id in the specified repository.
|
* Returns all commit id in the specified repository.
|
||||||
*/
|
*/
|
||||||
def getAllCommitIds(git: Git): Seq[String] = {
|
def getAllCommitIds(git: Git): Seq[String] = if(isEmpty(git)) {
|
||||||
|
Nil
|
||||||
|
} else {
|
||||||
val existIds = new scala.collection.mutable.ListBuffer[String]()
|
val existIds = new scala.collection.mutable.ListBuffer[String]()
|
||||||
val i = git.log.all.call.iterator
|
val i = git.log.all.call.iterator
|
||||||
while(i.hasNext){
|
while(i.hasNext){
|
||||||
|
|||||||
Reference in New Issue
Block a user