mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
branch deletion better distinguish local vs remote
This commit is contained in:
parent
035870e52f
commit
d6a2af89ee
4 changed files with 15 additions and 11 deletions
|
|
@ -768,7 +768,7 @@ impl App {
|
|||
sync::discard_lines(CWD, &path, &lines)?;
|
||||
flags.insert(NeedsUpdate::ALL);
|
||||
}
|
||||
Action::DeleteBranch(branch_ref, true) => {
|
||||
Action::DeleteLocalBranch(branch_ref) => {
|
||||
if let Err(e) = sync::delete_branch(CWD, &branch_ref)
|
||||
{
|
||||
self.queue.push(InternalEvent::ShowErrorMsg(
|
||||
|
|
@ -778,8 +778,9 @@ impl App {
|
|||
flags.insert(NeedsUpdate::ALL);
|
||||
self.select_branch_popup.update_branches()?;
|
||||
}
|
||||
Action::DeleteBranch(branch_ref, false) => {
|
||||
Action::DeleteRemoteBranch(branch_ref) => {
|
||||
self.queue.push(
|
||||
//TODO: check if this is correct based on the fix in `c6abbaf`
|
||||
branch_ref.rsplit('/').next().map_or_else(
|
||||
|| {
|
||||
InternalEvent::ShowErrorMsg(format!(
|
||||
|
|
|
|||
|
|
@ -659,13 +659,15 @@ impl BranchListComponent {
|
|||
}
|
||||
|
||||
fn delete_branch(&mut self) {
|
||||
let reference =
|
||||
self.branches[self.selection as usize].reference.clone();
|
||||
|
||||
self.queue.push(InternalEvent::ConfirmAction(
|
||||
Action::DeleteBranch(
|
||||
self.branches[self.selection as usize]
|
||||
.reference
|
||||
.clone(),
|
||||
self.local,
|
||||
),
|
||||
if self.local {
|
||||
Action::DeleteLocalBranch(reference)
|
||||
} else {
|
||||
Action::DeleteRemoteBranch(reference)
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ impl ConfirmComponent {
|
|||
strings::confirm_title_reset(),
|
||||
strings::confirm_msg_reset_lines(lines.len()),
|
||||
),
|
||||
Action::DeleteBranch(branch_ref, true) => (
|
||||
Action::DeleteLocalBranch(branch_ref) => (
|
||||
strings::confirm_title_delete_branch(
|
||||
&self.key_config,
|
||||
),
|
||||
|
|
@ -166,7 +166,7 @@ impl ConfirmComponent {
|
|||
branch_ref,
|
||||
),
|
||||
),
|
||||
Action::DeleteBranch(branch_ref, false) => (
|
||||
Action::DeleteRemoteBranch(branch_ref) => (
|
||||
strings::confirm_title_delete_remote_branch(
|
||||
&self.key_config,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ pub enum Action {
|
|||
ResetLines(String, Vec<DiffLinePosition>),
|
||||
StashDrop(Vec<CommitId>),
|
||||
StashPop(CommitId),
|
||||
DeleteBranch(String, bool),
|
||||
DeleteLocalBranch(String),
|
||||
DeleteRemoteBranch(String),
|
||||
DeleteTag(String),
|
||||
ForcePush(String, bool),
|
||||
PullMerge { incoming: usize, rebase: bool },
|
||||
|
|
|
|||
Loading…
Reference in a new issue