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,14 +482,22 @@ export const moveOperation = ({
482482
483483 if ( branchMoveOperation ) return branchMoveOperation ;
484484
485- const relativeTo : RelativeTo | null = Match . value ( target ) . pipe (
486- Match . tags ( {
487- Commit : ( { commitId } ) : RelativeTo | null => ( { type : "commit" , subject : commitId } ) ,
488- Branch : ( { branchRef } ) : RelativeTo | null => ( {
489- type : "referenceBytes" ,
490- subject : branchRef ,
491- } ) ,
492- } ) ,
485+ const relativeTo : RelativeTo | null = Match . value ( { target, side } ) . pipe (
486+ Match . when ( { target : { _tag : "Commit" } } , ( { target } ) : RelativeTo | null => ( {
487+ type : "commit" ,
488+ subject : target . commitId ,
489+ } ) ) ,
490+ Match . when (
491+ {
492+ target : { _tag : "Branch" } ,
493+ // We use the branch operand as the source/target for the branch
494+ // contents. However, `RelativeTo` is interpreted to mean just the
495+ // branch reference rather than the whole branch (reference + contents),
496+ // meaning `side: "below"` won't work as expected.
497+ side : "above" ,
498+ } ,
499+ ( { target } ) : RelativeTo | null => ( { type : "referenceBytes" , subject : target . branchRef } ) ,
500+ ) ,
493501 Match . orElse ( ( ) : RelativeTo | null => null ) ,
494502 ) ;
495503
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