diff options
author | Roberto Tyley <roberto.tyley@gmail.com> | 2014-05-25 19:34:24 +0100 |
---|---|---|
committer | Roberto Tyley <roberto.tyley@gmail.com> | 2014-05-26 11:09:22 +0100 |
commit | 568df19845bdb736642e723444362028523afab8 (patch) | |
tree | 1a364f2b8c666d085de3af0ce0128e02489b3f65 /org.eclipse.jgit.test | |
parent | fbef8eb3fa102d493450e4001f5b51a5365f6fec (diff) | |
download | jgit-568df19845bdb736642e723444362028523afab8.tar.gz jgit-568df19845bdb736642e723444362028523afab8.zip |
Remove a bit of repetition and casting in PackFileTest
PackFileTest lives in o.e.j.internal.storage.file, so I think it's OK for
it to acknowledge the existence of FileRepository in order to avoid some
unnecessary casting, and probably nicer to avoid the repetition too.
Change-Id: I0de592a32f6178e6d6bf114848101e185b3111a1
Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java index a19fcd9d50..3324627e7f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java @@ -95,7 +95,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { private TestRng rng; - private Repository repo; + private FileRepository repo; private TestRepository<Repository> tr; @@ -274,12 +274,9 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { deflate(pack, delta); byte[] footer = digest(pack); - File packName = new File(new File( - ((FileObjectDatabase) repo.getObjectDatabase()).getDirectory(), - "pack"), idA.name() + ".pack"); - File idxName = new File(new File( - ((FileObjectDatabase) repo.getObjectDatabase()).getDirectory(), - "pack"), idA.name() + ".idx"); + File dir = new File(repo.getObjectDatabase().getDirectory(), "pack"); + File packName = new File(dir, idA.name() + ".pack"); + File idxName = new File(dir, idA.name() + ".idx"); FileOutputStream f = new FileOutputStream(packName); try { |