You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Affected version: 2.8.0
Last unaffected version: 2.7.0
Behavior:
When creating BaseScmAdapter for each type it should find the right type depending on the repo type being used (Git, Svn, Mercurial...).
GitAdapter constructor not only instantiates the adapter but tries to find the current branch which provokes an exception when the repo type is not git and release fails.
2.8.0
GitAdapter(Project project, Map<String, Object> attributes) {
super(project, attributes)
workingBranch = gitCurrentBranch() //this is the line raising the exception
releaseBranch = extension.pushReleaseVersionBranch ? extension.pushReleaseVersionBranch : workingBranch
}
Expected behaviour:
In prior versions the adapter was instantiated and validated before trying to make any repo operations.
Steps to reproduce:
Try to release a Mercurial repo with gradle-release version 2.8.0
The text was updated successfully, but these errors were encountered:
carlosmagan
changed the title
Git Adapter constructor fails when trying to find current branch
GitAdapter constructor fails when trying to find current branch
Feb 6, 2019
The command I'm running is: gradlew release
The error obtained is:
Task :xxxxx-gradle:createScmAdapter FAILED
Running [git, branch, --no-color] produced an error: [fatal: not a git repository (or any of the parent directories): .git]
Task :release FAILED
Running [git, branch, --no-color] produced an error: [fatal: not a git repository (or any of the parent directories): .git]
Release process failed, please remember to revert any uncommitted changes made by the Release Plugin.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':xxxxx-gradle:createScmAdapter'.
java.lang.reflect.InvocationTargetException
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
This should be fixed as the search for .git, .hg, .svn, etc. should happen first to pick the correct SCM adapter. However there is a workaround if you know you are using a superior SCM system like Mercurial ;-) - specify the SCM adapter to use:
Affected version: 2.8.0
Last unaffected version: 2.7.0
Behavior:
When creating BaseScmAdapter for each type it should find the right type depending on the repo type being used (Git, Svn, Mercurial...).
GitAdapter constructor not only instantiates the adapter but tries to find the current branch which provokes an exception when the repo type is not git and release fails.
2.8.0
2.7.0
Expected behaviour:
In prior versions the adapter was instantiated and validated before trying to make any repo operations.
Steps to reproduce:
Try to release a Mercurial repo with gradle-release version 2.8.0
The text was updated successfully, but these errors were encountered: