Added option to delete remote branch from log
This commit is contained in:
parent
27d28cfdce
commit
d79095533d
@ -16,6 +16,7 @@ fun branchContextMenuItems(
|
|||||||
onMergeBranch: () -> Unit,
|
onMergeBranch: () -> Unit,
|
||||||
onRebaseBranch: () -> Unit,
|
onRebaseBranch: () -> Unit,
|
||||||
onDeleteBranch: () -> Unit,
|
onDeleteBranch: () -> Unit,
|
||||||
|
onDeleteRemoteBranch: () -> Unit = {},
|
||||||
onPushToRemoteBranch: () -> Unit,
|
onPushToRemoteBranch: () -> Unit,
|
||||||
onPullFromRemoteBranch: () -> Unit,
|
onPullFromRemoteBranch: () -> Unit,
|
||||||
): List<ContextMenuItem> {
|
): List<ContextMenuItem> {
|
||||||
@ -27,7 +28,7 @@ fun branchContextMenuItems(
|
|||||||
onClick = onCheckoutBranch
|
onClick = onCheckoutBranch
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if(currentBranch != null && !currentBranch.isHead) {
|
if (currentBranch != null && !currentBranch.isHead) {
|
||||||
add(
|
add(
|
||||||
ContextMenuItem(
|
ContextMenuItem(
|
||||||
label = "Merge branch",
|
label = "Merge branch",
|
||||||
@ -64,5 +65,13 @@ fun branchContextMenuItems(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (!isLocal) {
|
||||||
|
add(
|
||||||
|
ContextMenuItem(
|
||||||
|
label = "Delete remote branch",
|
||||||
|
onClick = onDeleteRemoteBranch
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -742,6 +742,7 @@ fun CommitLine(
|
|||||||
onCheckoutRef = { ref -> logViewModel.checkoutRef(ref) },
|
onCheckoutRef = { ref -> logViewModel.checkoutRef(ref) },
|
||||||
onMergeBranch = { ref -> onMergeBranch(ref) },
|
onMergeBranch = { ref -> onMergeBranch(ref) },
|
||||||
onDeleteBranch = { ref -> logViewModel.deleteBranch(ref) },
|
onDeleteBranch = { ref -> logViewModel.deleteBranch(ref) },
|
||||||
|
onDeleteRemoteBranch = { ref -> logViewModel.deleteRemoteBranch(ref) },
|
||||||
onDeleteTag = { ref -> logViewModel.deleteTag(ref) },
|
onDeleteTag = { ref -> logViewModel.deleteTag(ref) },
|
||||||
onRebaseBranch = { ref -> onRebaseBranch(ref) },
|
onRebaseBranch = { ref -> onRebaseBranch(ref) },
|
||||||
onPushRemoteBranch = { ref -> logViewModel.pushToRemoteBranch(ref) },
|
onPushRemoteBranch = { ref -> logViewModel.pushToRemoteBranch(ref) },
|
||||||
@ -762,6 +763,7 @@ fun CommitMessage(
|
|||||||
onCheckoutRef: (ref: Ref) -> Unit,
|
onCheckoutRef: (ref: Ref) -> Unit,
|
||||||
onMergeBranch: (ref: Ref) -> Unit,
|
onMergeBranch: (ref: Ref) -> Unit,
|
||||||
onDeleteBranch: (ref: Ref) -> Unit,
|
onDeleteBranch: (ref: Ref) -> Unit,
|
||||||
|
onDeleteRemoteBranch: (ref: Ref) -> Unit,
|
||||||
onRebaseBranch: (ref: Ref) -> Unit,
|
onRebaseBranch: (ref: Ref) -> Unit,
|
||||||
onDeleteTag: (ref: Ref) -> Unit,
|
onDeleteTag: (ref: Ref) -> Unit,
|
||||||
onPushRemoteBranch: (ref: Ref) -> Unit,
|
onPushRemoteBranch: (ref: Ref) -> Unit,
|
||||||
@ -797,6 +799,7 @@ fun CommitMessage(
|
|||||||
onCheckoutBranch = { onCheckoutRef(ref) },
|
onCheckoutBranch = { onCheckoutRef(ref) },
|
||||||
onMergeBranch = { onMergeBranch(ref) },
|
onMergeBranch = { onMergeBranch(ref) },
|
||||||
onDeleteBranch = { onDeleteBranch(ref) },
|
onDeleteBranch = { onDeleteBranch(ref) },
|
||||||
|
onDeleteRemoteBranch = { onDeleteRemoteBranch(ref) },
|
||||||
onRebaseBranch = { onRebaseBranch(ref) },
|
onRebaseBranch = { onRebaseBranch(ref) },
|
||||||
onPullRemoteBranch = { onPullRemoteBranch(ref) },
|
onPullRemoteBranch = { onPullRemoteBranch(ref) },
|
||||||
onPushRemoteBranch = { onPushRemoteBranch(ref) },
|
onPushRemoteBranch = { onPushRemoteBranch(ref) },
|
||||||
@ -991,6 +994,7 @@ fun BranchChip(
|
|||||||
onCheckoutBranch: () -> Unit,
|
onCheckoutBranch: () -> Unit,
|
||||||
onMergeBranch: () -> Unit,
|
onMergeBranch: () -> Unit,
|
||||||
onDeleteBranch: () -> Unit,
|
onDeleteBranch: () -> Unit,
|
||||||
|
onDeleteRemoteBranch: () -> Unit,
|
||||||
onRebaseBranch: () -> Unit,
|
onRebaseBranch: () -> Unit,
|
||||||
onPushRemoteBranch: () -> Unit,
|
onPushRemoteBranch: () -> Unit,
|
||||||
onPullRemoteBranch: () -> Unit,
|
onPullRemoteBranch: () -> Unit,
|
||||||
@ -1005,6 +1009,7 @@ fun BranchChip(
|
|||||||
onCheckoutBranch = onCheckoutBranch,
|
onCheckoutBranch = onCheckoutBranch,
|
||||||
onMergeBranch = onMergeBranch,
|
onMergeBranch = onMergeBranch,
|
||||||
onDeleteBranch = onDeleteBranch,
|
onDeleteBranch = onDeleteBranch,
|
||||||
|
onDeleteRemoteBranch = onDeleteRemoteBranch,
|
||||||
onRebaseBranch = onRebaseBranch,
|
onRebaseBranch = onRebaseBranch,
|
||||||
onPushToRemoteBranch = onPushRemoteBranch,
|
onPushToRemoteBranch = onPushRemoteBranch,
|
||||||
onPullFromRemoteBranch = onPullRemoteBranch,
|
onPullFromRemoteBranch = onPullRemoteBranch,
|
||||||
|
@ -355,6 +355,12 @@ class LogViewModel @Inject constructor(
|
|||||||
) {
|
) {
|
||||||
tabState.emitNewTaskEvent(TaskEvent.RebaseInteractive(revCommit))
|
tabState.emitNewTaskEvent(TaskEvent.RebaseInteractive(revCommit))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun deleteRemoteBranch(branch: Ref) = tabState.safeProcessing(
|
||||||
|
refreshType = RefreshType.ALL_DATA,
|
||||||
|
) { git ->
|
||||||
|
remoteOperationsManager.deleteBranch(git, branch)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class LogStatus {
|
sealed class LogStatus {
|
||||||
|
Loading…
Reference in New Issue
Block a user