The developer documentation (06.GitWorkFlows.md) asks contributors to run ./gradlew spotlessChangedApply before committing. Since org.gradle.configuration-cache=true was enabled in gradle.properties, this task and its helper changedOnBranch no longer work.
Bug 1 — incompatible with the configuration cache
Steps to reproduce on current master:
./gradlew changedOnBranch
Result:
> Task :changedOnBranch FAILED
1 problem was found storing the configuration cache.
- Task `:changedOnBranch` of type `org.gradle.api.DefaultTask`: invocation of 'providers' references a Gradle script object from a Groovy closure at execution time, which is unsupported with the configuration cache.
spotlessChangedApply fails the same way. The only workaround is --no-configuration-cache.
Cause: build-logic/src/main/groovy/org.omegat.spotless-conventions.gradle calls providers.exec inside doLast/doFirst blocks, i.e. at execution time.
Bug 2 — remote detection never worked
The same task tries to honor branch.<name>.pushRemote / branch.<name>.remote from the git config, but the check is
def remote = exe.result.get() == 0 ? exe.standardOutput.asText.get().trim() : ''
exe.result.get() returns an ExecResult object, so comparing it with the integer 0 is always false. The configured remote is therefore never used and the task always falls back to origin (with the warning "Could not detect git remote name. Assuming 'origin'."). In a clone where the upstream remote has a different name, git merge-base HEAD origin/master then fails and the task aborts.
Reproduce: in a clone whose remote is not named origin, run ./gradlew changedOnBranch --no-configuration-cache on any branch — the warning appears even though branch.<name>.remote is set.
A pull request fixing both issues is available: <pr-url></pr-url>
This ticket is solved in the 6.2.0 development version by https://github.com/omegat-org/omegat/pull/2152.