diff options
author | Emil Jaszczuk <44347542+remique@users.noreply.github.com> | 2022-09-19 10:54:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 10:54:29 +0200 |
commit | e0fa63c6c9052be17bab74ad30d9435fa2db975c (patch) | |
tree | 2f1aca0c3b718ddc6432b8eb98293b1c9a3acc20 /src/tabs | |
parent | 9534e4c2f99111c928dcd2e91ca9fe49364a7ed5 (diff) |
Allow copying multiple commits (#1288)
Diffstat (limited to 'src/tabs')
-rw-r--r-- | src/tabs/revlog.rs | 12 | ||||
-rw-r--r-- | src/tabs/stashlist.rs | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs index 9437fc00..710617ca 100644 --- a/src/tabs/revlog.rs +++ b/src/tabs/revlog.rs @@ -165,7 +165,11 @@ impl Revlog { } fn copy_commit_hash(&self) -> Result<()> { - self.list.copy_entry_hash()?; + if self.list.marked_count() > 1 { + self.list.copy_marked_hashes()?; + } else { + self.list.copy_entry_hash()?; + } Ok(()) } @@ -328,7 +332,7 @@ impl Component for Revlog { self.queue.push(InternalEvent::OpenPopup( StackablePopupOpen::CompareCommits( InspectCommitOpen::new( - self.list.marked()[0], + self.list.marked()[0].1, ), ), )); @@ -339,8 +343,8 @@ impl Component for Revlog { self.queue.push(InternalEvent::OpenPopup( StackablePopupOpen::CompareCommits( InspectCommitOpen { - commit_id: marked[0], - compare_id: Some(marked[1]), + commit_id: marked[0].1, + compare_id: Some(marked[1].1), tags: None, }, ), diff --git a/src/tabs/stashlist.rs b/src/tabs/stashlist.rs index dc3bc981..1d61d988 100644 --- a/src/tabs/stashlist.rs +++ b/src/tabs/stashlist.rs @@ -78,7 +78,7 @@ impl StashList { fn drop_stash(&mut self) { if self.list.marked_count() > 0 { self.queue.push(InternalEvent::ConfirmAction( - Action::StashDrop(self.list.marked().to_vec()), + Action::StashDrop(self.list.marked_commits()), )); } else if let Some(e) = self.list.selected_entry() { self.queue.push(InternalEvent::ConfirmAction( |