Skip to content

Commit c266522

Browse files
committed
feat: add an optional flag to specify a parent branch (#574)
1 parent c7e8a9a commit c266522

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

engine/cmd/cli/commands/branch/actions.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ func create(cliCtx *cli.Context) error {
181181

182182
branchName := cliCtx.Args().First()
183183

184+
baseBranch := cliCtx.String("parent-branch")
185+
186+
if baseBranch == "" {
187+
baseBranch = getBaseBranch(cliCtx)
188+
}
189+
184190
branchRequest := types.BranchCreateRequest{
185191
BranchName: branchName,
186-
BaseBranch: getBaseBranch(cliCtx),
192+
BaseBranch: baseBranch,
187193
}
188194

189195
branch, err := dblabClient.CreateBranch(cliCtx.Context, branchRequest)

engine/cmd/cli/commands/branch/command_list.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ func List() []*cli.Command {
2020
Name: "delete",
2121
Aliases: []string{"d"},
2222
},
23+
&cli.StringFlag{
24+
Name: "parent-branch",
25+
},
2326
},
2427
ArgsUsage: "BRANCH_NAME",
2528
},

0 commit comments

Comments
 (0)