Skip to content

refactor(hook): improve hook path resolution and add worktree/bare repo support#315

Open
vivindeena wants to merge 4 commits intoNutlope:developfrom
vivindeena:develop
Open

refactor(hook): improve hook path resolution and add worktree/bare repo support#315
vivindeena wants to merge 4 commits intoNutlope:developfrom
vivindeena:develop

Conversation

@vivindeena
Copy link

Summary

  • Convert isCalledFromGitHook to a function for better encapsulation
  • Use git rev-parse commands to dynamically resolve hooks directory
  • Add support for Git worktrees and bare repositories
  • Add comprehensive test coverage for various Git repository configurations

Changes

  • Add getGitHooksPath() function using git rev-parse --git-path hooks
  • Add getGitDir() helper function for Git directory resolution
  • Improve hook install/uninstall to handle absolute and relative hook paths
  • Add tests for worktree, bare repo, and subdirectory scenarios

@vivindeena
Copy link
Author

somewhat new to testing frameworks, hopefully it makes sense,

PS. also removed the requirement to have OPENAI_API_KEY to test hook integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant