File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
src/main/java/choonster/testmod3/gradle Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 1+ plugins {
2+ id ' java'
3+ }
4+
15repositories {
26 mavenCentral();
37}
48
59dependencies {
6- implementation " org.eclipse.jgit:org.eclipse.jgit:7.4.0.202509020913-r"
10+ implementation ' org.eclipse.jgit:org.eclipse.jgit:7.4.0.202509020913-r'
711}
Original file line number Diff line number Diff line change 11package choonster .testmod3 .gradle ;
22
3- import org .eclipse .jgit .lib .Constants ;
3+ import org .eclipse .jgit .lib .Config ;
4+ import org .eclipse .jgit .storage .file .FileBasedConfig ;
5+ import org .eclipse .jgit .util .FS ;
46import org .eclipse .jgit .util .SystemReader ;
57
6- import java .util .Objects ;
7-
88/**
99 * A {@link SystemReader} implementation that disables reading of system config.
1010 *
@@ -16,11 +16,19 @@ public NoSystemConfigSystemReader(final SystemReader delegate) {
1616 }
1717
1818 @ Override
19- public String getenv (final String variable ) {
20- if (Objects .equals (variable , Constants .GIT_CONFIG_NOSYSTEM_KEY )) {
21- return "true" ;
22- }
19+ public FileBasedConfig openSystemConfig (final Config parent , final FS fs ) {
20+ // Based on the SystemReader.Default#openSystemConfig implementation
21+ return new FileBasedConfig (parent , null , fs ) {
22+ @ Override
23+ public void load () {
24+ // empty, do not load
25+ }
2326
24- return super .getenv (variable );
27+ @ Override
28+ public boolean isOutdated () {
29+ // regular class would bomb here
30+ return false ;
31+ }
32+ };
2533 }
2634}
You can’t perform that action at this time.
0 commit comments