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 @@ -477,14 +477,22 @@ export const moveOperation = ({
477477
478478 if ( branchMoveOperation ) return branchMoveOperation ;
479479
480- const relativeTo : RelativeTo | null = Match . value ( target ) . pipe (
481- Match . tags ( {
482- Commit : ( { commitId } ) : RelativeTo | null => ( { type : "commit" , subject : commitId } ) ,
483- Branch : ( { branchRef } ) : RelativeTo | null => ( {
484- type : "referenceBytes" ,
485- subject : branchRef ,
486- } ) ,
487- } ) ,
480+ const relativeTo : RelativeTo | null = Match . value ( { target, side } ) . pipe (
481+ Match . when ( { target : { _tag : "Commit" } } , ( { target } ) : RelativeTo | null => ( {
482+ type : "commit" ,
483+ subject : target . commitId ,
484+ } ) ) ,
485+ Match . when (
486+ {
487+ target : { _tag : "Branch" } ,
488+ // We use the branch operand as the source/target for the branch
489+ // contents. However, `RelativeTo` is interpreted to mean just the
490+ // branch reference rather than the whole branch (reference + contents),
491+ // meaning `side: "below"` won't work as expected.
492+ side : "above" ,
493+ } ,
494+ ( { target } ) : RelativeTo | null => ( { type : "referenceBytes" , subject : target . branchRef } ) ,
495+ ) ,
488496 Match . orElse ( ( ) : RelativeTo | null => null ) ,
489497 ) ;
490498
Original file line number Diff line number Diff line change @@ -1498,18 +1498,13 @@ const BranchSegment: FC<{
14981498 aria-label = { refName . displayName }
14991499 expanded
15001500 className = { classes ( workspaceItemRowStyles . section , styles . segment ) }
1501+ render = { < OperandC projectId = { projectId } operand = { operand } /> }
15011502 >
1502- < OperandC
1503+ < BranchRow
15031504 projectId = { projectId }
1504- operand = { operand }
1505- render = {
1506- < BranchRow
1507- projectId = { projectId }
1508- branchName = { refName . displayName }
1509- branchRef = { refName . fullNameBytes }
1510- stackId = { stackId }
1511- />
1512- }
1505+ branchName = { refName . displayName }
1506+ branchRef = { refName . fullNameBytes }
1507+ stackId = { stackId }
15131508 />
15141509
15151510 { segment . commits . length === 0 ? (
You can’t perform that action at this time.
0 commit comments