(refs #343)Retrieve all commit id from Git repository in pre commit hook instead of COMMIT_LOG table

This commit is contained in:
Naoki Takezoe
2014-04-10 17:42:25 +09:00
parent 8fbbe7f31e
commit 3f76453f34
7 changed files with 45 additions and 80 deletions

View File

@@ -570,4 +570,16 @@ object JGitUtil {
case e: MissingObjectException => None
}
/**
* Returns all commit id in the specified repository.
*/
def getAllCommitIds(git: Git): Seq[String] = {
val existIds = new scala.collection.mutable.ListBuffer[String]()
val i = git.log.all.call.iterator
while(i.hasNext){
existIds += i.next.name
}
existIds.toSeq
}
}