fix(install): prompt to create missing .git/hooks folder#80
Merged
albertodebortoli merged 1 commit intomainfrom May 9, 2026
Merged
fix(install): prompt to create missing .git/hooks folder#80albertodebortoli merged 1 commit intomainfrom
albertodebortoli merged 1 commit intomainfrom
Conversation
…ailing silently When the hooks directory is absent, GitHookInstaller now asks the user via a Noora yesOrNoChoicePrompt whether Luca should create it, giving a clear actionable message instead of a cryptic copy failure.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull Request Title
fix(install): prompt to create missing .git/hooks folder
Description
luca install --install-post-checkout-git-hookran in a repo where.git/hooksdidn't exist,FileManager.copyItemwould fail with a cryptic low-level error ("The file post-checkout doesn't exist").GitHookInstallernow detects the missing directory and asks the user via a NoorayesOrNoChoicePrompt("Create missing hooks folder: Yes/No") whether Luca should create it. If the user declines, installation is skipped cleanly.Type of Change
How Has This Been Tested?
Two new tests added to
GitHookInstallerTests:test_installPostCheckoutHook_whenHooksDirMissing_userConfirms_createsDirectoryAndInstallstest_installPostCheckoutHook_whenHooksDirMissing_userDeclines_skipsInstallationNoorableMock.yesOrNoChoicePromptis now configurable viayesOrNoAnswer: Boolinstead offatalError.Checklist
Breaking Changes?
Additional Notes
GitHookInstallerFileManaginggains acreateDirectory(at:withIntermediateDirectories:)requirement;FileManagerWrapperandFileManagerWrapperMockalready implement it so no additional changes are needed there.