@@ -2,10 +2,10 @@ package com.madgag.git.bfg.test
2
2
3
3
import com .madgag .git ._
4
4
import com .madgag .git .test ._
5
- import org .eclipse .jgit .internal .storage .file .{GC , ObjectDirectory }
5
+ import org .eclipse .jgit .internal .storage .file .{FileRepository , GC , ObjectDirectory }
6
6
import org .eclipse .jgit .lib .Constants .OBJ_BLOB
7
7
import org .eclipse .jgit .lib .{ObjectId , ObjectReader , Repository }
8
- import org .eclipse .jgit .revwalk .{RevCommit , RevTree }
8
+ import org .eclipse .jgit .revwalk .{RevCommit , RevTree , RevWalk }
9
9
import org .eclipse .jgit .treewalk .TreeWalk
10
10
import org .scalatest .Inspectors
11
11
import org .scalatest .flatspec .AnyFlatSpec
@@ -16,9 +16,9 @@ import scala.jdk.CollectionConverters._
16
16
17
17
class unpackedRepo (filePath : String ) extends AnyFlatSpec with Matchers {
18
18
19
- implicit val repo = unpackRepo(filePath)
20
- implicit val objectDirectory = repo.getObjectDatabase. asInstanceOf [ ObjectDirectory ]
21
- implicit lazy val (revWalk, reader) = repo.singleThreadedReaderTuple
19
+ implicit val repo : FileRepository = unpackRepo(filePath)
20
+ implicit val objectDirectory : ObjectDirectory = repo.getObjectDatabase
21
+ implicit lazy val (revWalk : RevWalk , reader : ObjectReader ) = repo.singleThreadedReaderTuple
22
22
23
23
24
24
def blobOfSize (sizeInBytes : Int ): Matcher [ObjectId ] = Matcher { (objectId : ObjectId ) =>
@@ -29,8 +29,8 @@ class unpackedRepo(filePath: String) extends AnyFlatSpec with Matchers {
29
29
}
30
30
31
31
def packedBlobsOfSize (sizeInBytes : Long ): Set [ObjectId ] = {
32
- implicit val reader = repo.newObjectReader()
33
- repo.getObjectDatabase.asInstanceOf [ ObjectDirectory ]. packedObjects.filter { objectId =>
32
+ implicit val reader : ObjectReader = repo.newObjectReader()
33
+ repo.getObjectDatabase.packedObjects.filter { objectId =>
34
34
val objectLoader = objectId.open
35
35
objectLoader.getType == OBJ_BLOB && objectLoader.getSize == sizeInBytes
36
36
}.toSet
0 commit comments