Closed
Description
So there's a problem, directory created by a worktree command doesn't have .git
directory.
ChatGPT suggested this fix, and it appears to be working for me. @Jolanrensen what do you think?
val installGitPreCommitHook by tasks.creating(Copy::class) {
doNotTrackState(/* reasonNotToTrackState = */ "Fails on TeamCity otherwise.")
val gitHooksDir = File(rootProject.rootDir, ".git/hooks")
if (gitHooksDir.exists()) {
from(File(rootProject.rootDir, "gradle/scripts/pre-commit"))
into(gitHooksDir)
fileMode = 755
} else {
logger.lifecycle("'.git/hooks' directory not found. Skipping installGitPreCommitHook task.")
}
}
Metadata
Metadata
Assignees
Labels
No labels