fix: show revision-aware blame in diff buffers
Diff and snapshot sources were excluded before scheduling, and the separate diff renderer never painted attribution. Capture per-side Git provenance, preserve private object stores for historical tabs, and reuse the current-line worker and cache.
This commit is contained in:
+11
@@ -4,6 +4,7 @@ use std::{
|
||||
borrow::Cow,
|
||||
collections::{BTreeMap, BTreeSet},
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
@@ -141,10 +142,19 @@ pub struct ChangedFile {
|
||||
pub hunks: Vec<Hunk>,
|
||||
pub notice: Option<String>,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct BlameRevision {
|
||||
pub store: PathBuf,
|
||||
pub commit: String,
|
||||
pub(crate) keepalive: Option<Arc<crate::repository::Temporary>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Comparison {
|
||||
/// Immutable comparison-context IDs; captured review text also freezes live edits.
|
||||
pub revisions: [String; 2],
|
||||
/// Git object stores and immutable attribution baselines for Before/After.
|
||||
pub blame: [Option<BlameRevision>; 2],
|
||||
pub before: String,
|
||||
pub after: String,
|
||||
pub files: Vec<ChangedFile>,
|
||||
@@ -670,6 +680,7 @@ impl DiffState {
|
||||
pub(crate) fn set_resolver_paths(&mut self, root: PathBuf, paths: Vec<PathBuf>, file: usize) {
|
||||
let comparison = self.comparison.get_or_insert_with(|| Comparison {
|
||||
revisions: Default::default(),
|
||||
blame: Default::default(),
|
||||
before: "Resolution".into(),
|
||||
after: "Other version".into(),
|
||||
files: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user