File tree Expand file tree Collapse file tree
routes/project/$id/workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -482,12 +482,23 @@ export const moveOperation = ({
482482
483483 if ( branchMoveOperation ) return branchMoveOperation ;
484484
485- const relativeTo : RelativeTo | null = Match . value ( target ) . pipe (
485+ const relativeTo : RelativeTo | null = Match . value ( { target, side } ) . pipe (
486486 Match . withReturnType < RelativeTo | null > ( ) ,
487- Match . tags ( {
488- Commit : ( { commitId } ) => ( { type : "commit" , subject : commitId } ) ,
489- Branch : ( { branchRef } ) => ( { type : "referenceBytes" , subject : branchRef } ) ,
490- } ) ,
487+ Match . when ( { target : { _tag : "Commit" } } , ( { target } ) => ( {
488+ type : "commit" ,
489+ subject : target . commitId ,
490+ } ) ) ,
491+ Match . when (
492+ {
493+ target : { _tag : "Branch" } ,
494+ // We use the branch operand as the source/target for the branch
495+ // contents. However, `RelativeTo` is interpreted to mean just the
496+ // branch reference rather than the whole branch (reference + contents),
497+ // meaning `side: "below"` won't work as expected.
498+ side : "above" ,
499+ } ,
500+ ( { target } ) => ( { type : "referenceBytes" , subject : target . branchRef } ) ,
501+ ) ,
491502 Match . orElse ( ( ) => null ) ,
492503 ) ;
493504
Original file line number Diff line number Diff line change @@ -1488,18 +1488,13 @@ const BranchSegment: FC<{
14881488 aria-label = { refName . displayName }
14891489 expanded
14901490 className = { classes ( workspaceItemRowStyles . section , styles . segment ) }
1491+ render = { < OperandC projectId = { projectId } operand = { operand } /> }
14911492 >
1492- < OperandC
1493+ < BranchRow
14931494 projectId = { projectId }
1494- operand = { operand }
1495- render = {
1496- < BranchRow
1497- projectId = { projectId }
1498- branchName = { refName . displayName }
1499- branchRef = { refName . fullNameBytes }
1500- stackId = { stackId }
1501- />
1502- }
1495+ branchName = { refName . displayName }
1496+ branchRef = { refName . fullNameBytes }
1497+ stackId = { stackId }
15031498 />
15041499
15051500 { segment . commits . length === 0 ? (
You can’t perform that action at this time.
0 commit comments