feat(rig): Add --branch flag for custom default branch
Add --branch flag to `gt rig add` to specify a custom default branch instead of auto-detecting from remote. This supports repositories that use non-standard default branches like `develop` or `release`. Changes: - Add --branch flag to `gt rig add` command - Store default_branch in rig config.json - Propagate default branch to refinery, witness, daemon, and all commands - Rename ensureMainBranch to ensureDefaultBranch for clarity - Add Rig.DefaultBranch() method for consistent access - Update crew/manager.go and swarm/manager.go to use rig config Based on PR #49 by @kustrun - rebased and extended with additional fixes. Co-authored-by: kustrun <kustrun@users.noreply.github.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
31df1bb2c1
commit
eea4435269
@@ -252,6 +252,7 @@ Examples:
|
||||
var (
|
||||
rigAddPrefix string
|
||||
rigAddLocalRepo string
|
||||
rigAddBranch string
|
||||
rigResetHandoff bool
|
||||
rigResetMail bool
|
||||
rigResetStale bool
|
||||
@@ -281,6 +282,7 @@ func init() {
|
||||
|
||||
rigAddCmd.Flags().StringVar(&rigAddPrefix, "prefix", "", "Beads issue prefix (default: derived from name)")
|
||||
rigAddCmd.Flags().StringVar(&rigAddLocalRepo, "local-repo", "", "Local repo path to share git objects (optional)")
|
||||
rigAddCmd.Flags().StringVar(&rigAddBranch, "branch", "", "Default branch name (default: auto-detected from remote)")
|
||||
|
||||
rigResetCmd.Flags().BoolVar(&rigResetHandoff, "handoff", false, "Clear handoff content")
|
||||
rigResetCmd.Flags().BoolVar(&rigResetMail, "mail", false, "Clear stale mail messages")
|
||||
@@ -340,10 +342,11 @@ func runRigAdd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// Add the rig
|
||||
newRig, err := mgr.AddRig(rig.AddRigOptions{
|
||||
Name: name,
|
||||
GitURL: gitURL,
|
||||
BeadsPrefix: rigAddPrefix,
|
||||
LocalRepo: rigAddLocalRepo,
|
||||
Name: name,
|
||||
GitURL: gitURL,
|
||||
BeadsPrefix: rigAddPrefix,
|
||||
LocalRepo: rigAddLocalRepo,
|
||||
DefaultBranch: rigAddBranch,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("adding rig: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user