feat(hooks): add DeleteBranch for import branch cleanup
- Add DeleteBranch method to DoltStore for removing branches - Update hookPostMergeDolt to clean up import branches after merge - Completes hq-ew1mbr.9 git hook infrastructure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
13af11768f
commit
62dd5f8585
@@ -553,6 +553,7 @@ func hookPostMergeDolt(beadsDir string) int {
|
||||
Merge(ctx context.Context, branch string) error
|
||||
Commit(ctx context.Context, message string) error
|
||||
CurrentBranch(ctx context.Context) (string, error)
|
||||
DeleteBranch(ctx context.Context, branch string) error
|
||||
})
|
||||
if !ok {
|
||||
// Not a Dolt store with version control, use regular import
|
||||
@@ -613,7 +614,11 @@ func hookPostMergeDolt(beadsDir string) int {
|
||||
// This is expected, not an error
|
||||
}
|
||||
|
||||
// TODO: Delete import branch (need to add DeleteBranch method to DoltStore)
|
||||
// Clean up import branch
|
||||
if err := doltStore.DeleteBranch(ctx, importBranch); err != nil {
|
||||
// Non-fatal - branch cleanup is best-effort
|
||||
fmt.Fprintf(os.Stderr, "Warning: could not delete import branch %s: %v\n", importBranch, err)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user