Skip to content

Commit

Permalink
Fixed rebase and merge of remotes branches not working in side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
JetpackDuba committed Aug 31, 2024
1 parent cb705f2 commit 70941c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/main/kotlin/com/jetpackduba/gitnuro/ui/SidePanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ fun LazyListScope.remotes(
onDeleteBranch = { remotesViewModel.deleteRemoteBranch(remoteBranch) },
onPushRemoteBranch = { remotesViewModel.pushToRemoteBranch(remoteBranch) },
onPullRemoteBranch = { remotesViewModel.pullFromRemoteBranch(remoteBranch) },
onRebaseRemoteBranch = { remotesViewModel.rebaseBranch(remoteBranch) },
onMergeRemoteBranch = { remotesViewModel.mergeBranch(remoteBranch) },
)
}
}
Expand Down Expand Up @@ -504,6 +506,8 @@ private fun RemoteBranches(
onDeleteBranch: () -> Unit,
onPushRemoteBranch: () -> Unit,
onPullRemoteBranch: () -> Unit,
onRebaseRemoteBranch: () -> Unit,
onMergeRemoteBranch: () -> Unit,
) {
ContextMenu(
items = {
Expand All @@ -513,10 +517,10 @@ private fun RemoteBranches(
isCurrentBranch = false,
isLocal = false,
onCheckoutBranch = onCheckoutBranch,
onMergeBranch = {},
onMergeBranch = onMergeRemoteBranch,
onDeleteBranch = {},
onDeleteRemoteBranch = onDeleteBranch,
onRebaseBranch = {},
onRebaseBranch = onRebaseRemoteBranch,
onPushToRemoteBranch = onPushRemoteBranch,
onPullFromRemoteBranch = onPullRemoteBranch,
onChangeDefaultUpstreamBranch = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import com.jetpackduba.gitnuro.git.branches.GetRemoteBranchesUseCase
import com.jetpackduba.gitnuro.git.remotes.*
import com.jetpackduba.gitnuro.models.RemoteWrapper
import com.jetpackduba.gitnuro.models.positiveNotification
import com.jetpackduba.gitnuro.viewmodels.ISharedBranchesViewModel
import com.jetpackduba.gitnuro.viewmodels.ISharedRemotesViewModel
import com.jetpackduba.gitnuro.viewmodels.SharedBranchesViewModel
import com.jetpackduba.gitnuro.viewmodels.SharedRemotesViewModel
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
Expand All @@ -34,11 +36,14 @@ class RemotesViewModel @AssistedInject constructor(
private val addRemoteUseCase: AddRemoteUseCase,
private val updateRemoteUseCase: UpdateRemoteUseCase,
private val deleteLocallyRemoteBranchesUseCase: DeleteLocallyRemoteBranchesUseCase,
private val sharedBranchesViewModel: SharedBranchesViewModel,
tabScope: CoroutineScope,
sharedRemotesViewModel: SharedRemotesViewModel,
@Assisted
private val filter: StateFlow<String>
) : SidePanelChildViewModel(false), ISharedRemotesViewModel by sharedRemotesViewModel {
) : SidePanelChildViewModel(false), ISharedRemotesViewModel by sharedRemotesViewModel,
ISharedBranchesViewModel by sharedBranchesViewModel {

private val remotes = MutableStateFlow<List<RemoteView>>(listOf())
private val currentBranch = MutableStateFlow<Ref?>(null)

Expand Down

0 comments on commit 70941c5

Please sign in to comment.