Add noop Git Config System Reader to prevent usage of real world stuff into jgit#13703
Merged
Conversation
2 tasks
Contributor
|
You beat me to it. My impl. is a little different: import java.io.IOException;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.util.SystemReader;
/**
* A {@code SystemReader} that buffers JGit tests from their environment.
*/
public class NoUserConfigurationSystemReader extends SystemReader.Delegate {
private static final StoredConfig NOP = new StoredConfig() {
@Override
public void load() { }
@Override
public void save() { }
};
public NoUserConfigurationSystemReader() {
super(SystemReader.getInstance());
}
@Override
public StoredConfig getUserConfig() throws ConfigInvalidException, IOException {
return NOP;
}
}... I tested what the minimum needed to 'filter' was. Anyway, they both work. Thanks. |
Member
Author
|
I will switch to your code, more elegant! Only after I implemented it I saw the delegate |
Co-authored-by: Chris Denman <chrisdenman@ceilingcat.co.uk>
|
@trag-bot didn't find any issues in the code! ✅✨ |
Siedlerchr
added a commit
that referenced
this pull request
Aug 21, 2025
* upstream/main: New translations jabref_en.properties (Italian) (#13725) Minor code style updates (#13722) Fix: Make FileUtil.relativize symlink-aware (#13553) New Crowdin updates (#13720) Bump org.glassfish.jersey.core:jersey-server in /versions (#13714) Enable UseObjectNotifyAll (#13718) Bump com.dlsc.gemsfx:gemsfx from 3.3.5 to 3.4.2 in /versions (#13717) Update on-issue-comment.yml Bump org.openrewrite.recipe:rewrite-recipe-bom from 3.12.1 to 3.13.0 (#13716) Bump org.openrewrite.rewrite from 7.12.1 to 7.14.0 (#13715) Bump org.glassfish.jersey.inject:jersey-hk2 in /versions (#13713) feat(git): add “Share to GitHub” flow (#13677) Bump jablib/src/main/resources/csl-styles from `292aec3` to `1194364` (#13712) Bump jablib/src/main/abbrv.jabref.org from `cfe719f` to `a97f9c6` (#13711) Bump jablib/src/main/resources/csl-locales from `e2de1e3` to `fa56de1` (#13710) Add noop Git Config System Reader to prevent usage of real world stuff into jgit (#13703) Added static (stream & preferences) constructors to BibDatabaseContext (#13694) New Crowdin updates (#13698) fix git modules requires and uses (#13696) Focus "Specify Bib(La)TeX" when Bib(La)TeX is in clipboard (#13633)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13695 (comment)
Steps to test
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)