fix bug where scminfo.origin is not populated#117
Merged
wakingrufus merged 1 commit intomainfrom Jan 23, 2026
Merged
Conversation
if .git directory is detected, but git command fails, it was wa causing the scminfo.origin property to have a null value for the conventions, which causes an error when accessed elsewhere in the plugin. this change will fallback to LOCAL when the git command fails to find the origin (ie git is not installed, or there is no remote set) modernize some tests to allow gradle cache to be used in github actions
3fde94e to
96bad5b
Compare
rpalcolea
reviewed
Jan 23, 2026
| @NullMarked | ||
| public class TestHelpers { | ||
| public static void withGit(File workingDir, Consumer<Git> work) { | ||
| try (Git git = Git.init().setBare(false).setDirectory(workingDir).setInitialBranch("main").call()) { |
Member
Author
There was a problem hiding this comment.
I am trying to get away from grgit and use plain jgit to make transition off of groovy easier
Member
There was a problem hiding this comment.
yeah, even though we cleaned up the usage of grgit in plugins due to config cache, we never cleaned up the usage in tests. Using jgit directly makes sense to me
rpalcolea
reviewed
Jan 23, 2026
| private String executeGitCommand(File projectDir, Object... args) { | ||
| try { | ||
| return providerFactory.exec { | ||
| it.workingDir(projectDir) |
Member
There was a problem hiding this comment.
this makes complete sense, thanks for fixing this
Member
Author
There was a problem hiding this comment.
yeah this fixed issues I was having in the tests where the git command was not executing in the test project directory
rpalcolea
approved these changes
Jan 23, 2026
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.
if .git directory is detected, but git command fails, it was wa causing the scminfo.origin property to have a null value for the conventions, which causes an error when accessed elsewhere in the plugin. this change will fallback to LOCAL when the git command fails to find the origin (ie git is not installed, or there is no remote set)
modernize some tests to allow gradle cache to be used in github actions