Description
Reproduction steps:
1. `git gc`
2. `./gradlew jar`
Expected behavior: build completes successfully (or shows other build errors)
Actual behavior:
Task failed with an exception. ----------- * What went wrong: A problem was found with the configuration of task ':storage:createVersionFile' (type 'DefaultTask'). - Property 'commitId' doesn't have a configured value. Reason: This property isn't marked as optional and no value has been configured. Possible solutions: 1. Assign a value to 'commitId'. 2. Mark property 'commitId' as optional. Please refer to https://docs.gradle.org/7.6/userguide/validation_problems.html#value_not_set for more details about this problem.
This appears to be due to the fact that the build.gradle determineCommitId() function is unable to read the git commit hash for the current HEAD. This appears to happen after a `git gc` takes place, which causes the `.git/refs/heads/*` files to be moved to `.git/packed-refs`.
The determineCommitId() should be patched to also try reading from the packed-refs to determine the commit hash.
Attachments
Issue Links
- links to