Commit d0cd377
committed
Tweak
The `unpackRepo()` method is very useful for setting up example repo fixtures for
testing - it unzips zipped git archives on the resource classpath, and returns us
the JGit repository. However, loading resources from the classpath (while convenient,
meaning we don't need to worry about the absolute location on the filesystem of the
zip file) can also be temperamental, with the resource not being found if it's not
within the same classloader as the class of `com.madgag.git.test`.
It seems the most reliable way to be able to find our test resources is to specify
_which_ class we want to search the classpath of when we search for the resource. From
there, we can get an unambiguous path for the resource that can be used by
`unpackRepo()`.unpackRepo(), allow specifying an explicit Path for the resource1 parent 3077901 commit d0cd377
File tree
1 file changed
+19
-17
lines changed- scala-git-test/src/main/scala/com/madgag/git/test
1 file changed
+19
-17
lines changedLines changed: 19 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
35 | 31 | | |
36 | | - | |
37 | | - | |
| 32 | + | |
| 33 | + | |
38 | 34 | | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | | - | |
41 | | - | |
| 38 | + | |
| 39 | + | |
42 | 40 | | |
43 | | - | |
44 | | - | |
| 41 | + | |
45 | 42 | | |
46 | | - | |
| 43 | + | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
0 commit comments