fix(dolt): recognize shim hooks as Dolt-compatible

Shim hooks (bd-shim marker) delegate to 'bd hook' command which already
handles Dolt backend correctly. Update both doctor check and migration
warning to recognize shim hooks as OK.

Only inline hooks (older style with embedded logic) need the explicit
Dolt backend check in the shell script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/joe
2026-01-25 12:04:06 -08:00
parent a93c32b425
commit ca51980ffc
2 changed files with 22 additions and 5 deletions

View File

@@ -800,7 +800,16 @@ func CheckGitHooksDoltCompatibility(path string) DoctorCheck {
contentStr := string(content)
// Check if it's a bd hook
// Shim hooks (bd-shim) delegate to 'bd hook' which handles Dolt correctly
if strings.Contains(contentStr, bdShimMarker) {
return DoctorCheck{
Name: "Git Hooks Dolt Compatibility",
Status: StatusOK,
Message: "Shim hooks (Dolt handled by bd hook command)",
}
}
// Check if it's a bd inline hook
if !strings.Contains(contentStr, bdInlineHookMarker) && !strings.Contains(contentStr, "bd") {
return DoctorCheck{
Name: "Git Hooks Dolt Compatibility",
@@ -809,12 +818,12 @@ func CheckGitHooksDoltCompatibility(path string) DoctorCheck {
}
}
// Check if it has the Dolt backend skip logic
// Check if inline hook has the Dolt backend skip logic
if strings.Contains(contentStr, `"backend"`) && strings.Contains(contentStr, `"dolt"`) {
return DoctorCheck{
Name: "Git Hooks Dolt Compatibility",
Status: StatusOK,
Message: "Hooks have Dolt backend check",
Message: "Inline hooks have Dolt backend check",
}
}