File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
engine/cmd/cli/commands/branch Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,11 @@ func create(cliCtx *cli.Context) error {
182182 branchName := cliCtx .Args ().First ()
183183
184184 baseBranch := cliCtx .String ("parent-branch" )
185+ snapshotID := cliCtx .String ("snapshot-id" )
186+
187+ if baseBranch != "" && snapshotID != "" {
188+ return commands .NewActionError ("either --parent-branch or --snapshot-id must be specified" )
189+ }
185190
186191 if baseBranch == "" {
187192 baseBranch = getBaseBranch (cliCtx )
@@ -190,6 +195,7 @@ func create(cliCtx *cli.Context) error {
190195 branchRequest := types.BranchCreateRequest {
191196 BranchName : branchName ,
192197 BaseBranch : baseBranch ,
198+ SnapshotID : snapshotID ,
193199 }
194200
195201 branch , err := dblabClient .CreateBranch (cliCtx .Context , branchRequest )
Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ func List() []*cli.Command {
2121 Aliases : []string {"d" },
2222 },
2323 & cli.StringFlag {
24- Name : "parent-branch" ,
24+ Name : "parent-branch" ,
25+ Usage : "specify branch name as starting point for new branch; cannot be used together with --snapshot-id" ,
26+ },
27+ & cli.StringFlag {
28+ Name : "snapshot-id" ,
29+ Usage : "specify snapshot ID is starting point for new branch; cannot be used together with --parent-branch" ,
2530 },
2631 },
2732 ArgsUsage : "BRANCH_NAME" ,
You can’t perform that action at this time.
0 commit comments