feat(mq): implement integration land command (gt-h5n.5)
Add 'gt mq integration land <epic>' command that: - Verifies all MRs targeting integration/<epic> are merged - Verifies integration branch exists - Merges integration/<epic> to main (--no-ff) - Runs tests on main (if configured) - Pushes to origin - Deletes integration branch (local and remote) - Updates epic status to closed Options: - --force: land even if some MRs still open - --skip-tests: skip test run - --dry-run: preview only Also adds: - MergeNoFF() and DeleteRemoteBranch() to git package - WorkDir() accessor for git.Git - Unit tests for mq helper functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,11 @@ func NewGit(workDir string) *Git {
|
||||
return &Git{workDir: workDir}
|
||||
}
|
||||
|
||||
// WorkDir returns the working directory for this Git instance.
|
||||
func (g *Git) WorkDir() string {
|
||||
return g.workDir
|
||||
}
|
||||
|
||||
// run executes a git command and returns stdout.
|
||||
func (g *Git) run(args ...string) (string, error) {
|
||||
cmd := exec.Command("git", args...)
|
||||
@@ -201,6 +206,18 @@ func (g *Git) Merge(branch string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// MergeNoFF merges the given branch with --no-ff flag and a custom message.
|
||||
func (g *Git) MergeNoFF(branch, message string) error {
|
||||
_, err := g.run("merge", "--no-ff", "-m", message, branch)
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteRemoteBranch deletes a branch on the remote.
|
||||
func (g *Git) DeleteRemoteBranch(remote, branch string) error {
|
||||
_, err := g.run("push", remote, "--delete", branch)
|
||||
return err
|
||||
}
|
||||
|
||||
// Rebase rebases the current branch onto the given ref.
|
||||
func (g *Git) Rebase(onto string) error {
|
||||
_, err := g.run("rebase", onto)
|
||||
|
||||
Reference in New Issue
Block a user