fix: install pre-checkout hook in gt git-init
The hook was only installed via 'gt install --git' but not when running 'gt git-init' separately.
This commit is contained in:
@@ -138,6 +138,11 @@ func runGitInit(cmd *cobra.Command, args []string) error {
|
|||||||
fmt.Printf(" ✓ Git repository already exists\n")
|
fmt.Printf(" ✓ Git repository already exists\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Install pre-checkout hook to prevent accidental branch switches
|
||||||
|
if err := InstallPreCheckoutHook(hqRoot); err != nil {
|
||||||
|
fmt.Printf(" %s Could not install pre-checkout hook: %v\n", style.Dim.Render("⚠"), err)
|
||||||
|
}
|
||||||
|
|
||||||
// Create GitHub repo if requested
|
// Create GitHub repo if requested
|
||||||
if gitInitGitHub != "" {
|
if gitInitGitHub != "" {
|
||||||
if err := createGitHubRepo(hqRoot, gitInitGitHub, !gitInitPublic); err != nil {
|
if err := createGitHubRepo(hqRoot, gitInitGitHub, !gitInitPublic); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user