Skip to content

Commit 21e22a7

Browse files
committed
fix: prioritize --branch flag over default behavior
1 parent 5d36eca commit 21e22a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/murphy/internal/scan/scan.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ func scan(ctx context.Context, dir string, accessType model.AccessType, mode mod
155155
createSubtask.PackagePrivateName = privateSourceName
156156
createSubtask.ProjectTagNames = projectTagNames
157157
createSubtask.IsAutonomous = scanCodeHash
158-
createSubtask.Branch = &branch
159158
if createSubtask.ProjectTagNames == nil {
160159
createSubtask.ProjectTagNames = make([]string, 0)
161160
}
@@ -180,6 +179,9 @@ func scan(ctx context.Context, dir string, accessType model.AccessType, mode mod
180179
} else {
181180
assignGitInfoToCreateSubtaskReq(&createSubtask, gitSummary)
182181
}
182+
if branch != "" {
183+
createSubtask.Branch = &branch
184+
}
183185

184186
// call API
185187
createTaskResp, e := api.CreateSubTask(api.DefaultClient(), &createSubtask)

0 commit comments

Comments
 (0)