|
|
|
@ -72,7 +72,9 @@ import org.eclipse.jgit.lib.ReflogReader;
|
|
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
|
import org.eclipse.jgit.storage.file.FileBasedConfig; |
|
|
|
|
import org.eclipse.jgit.storage.file.FileRepositoryBuilder; |
|
|
|
|
import org.eclipse.jgit.util.FS; |
|
|
|
|
import org.eclipse.jgit.util.FileUtils; |
|
|
|
|
import org.eclipse.jgit.util.StringUtils; |
|
|
|
|
import org.eclipse.jgit.util.SystemReader; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -162,7 +164,21 @@ public class FileRepository extends Repository {
|
|
|
|
|
public FileRepository(final BaseRepositoryBuilder options) throws IOException { |
|
|
|
|
super(options); |
|
|
|
|
|
|
|
|
|
systemConfig = SystemReader.getInstance().openSystemConfig(null, getFS()); |
|
|
|
|
if (StringUtils.isEmptyOrNull(SystemReader.getInstance().getenv( |
|
|
|
|
Constants.GIT_CONFIG_NOSYSTEM_KEY))) |
|
|
|
|
systemConfig = SystemReader.getInstance().openSystemConfig(null, |
|
|
|
|
getFS()); |
|
|
|
|
else |
|
|
|
|
systemConfig = new FileBasedConfig(null, FS.DETECTED) { |
|
|
|
|
public void load() { |
|
|
|
|
// empty, do not load
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean isOutdated() { |
|
|
|
|
// regular class would bomb here
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
userConfig = SystemReader.getInstance().openUserConfig(systemConfig, |
|
|
|
|
getFS()); |
|
|
|
|
repoConfig = new FileBasedConfig(userConfig, getFS().resolve( |
|
|
|
|