Skip to content

Commit 604d032

Browse files
committed
Update to gix-blame 0.1.0
1 parent 007bda7 commit 604d032

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

Cargo.lock

+20-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asyncgit/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gix = { version = "0.71.0", default-features = false, features = [
2424
"revision",
2525
"blob-diff"
2626
] }
27-
gix-blame = "0.0.0"
27+
gix-blame = "0.1.0"
2828
log = "0.4"
2929
# git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]}
3030
# git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]}

asyncgit/src/sync/blame.rs

+13-8
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,27 @@ pub fn blame_file(
6060
),
6161
_ => repo.head()?.peel_to_commit_in_place()?.id,
6262
};
63-
let traverse = gix::traverse::commit::topo::Builder::from_iters(
64-
&repo.objects,
65-
[tip],
66-
None::<Vec<gix::ObjectId>>,
67-
)
68-
.build()?;
6963

64+
let cache: Option<gix::commitgraph::Graph> =
65+
repo.commit_graph_if_enabled().expect("TODO");
7066
let mut resource_cache =
7167
repo.diff_resource_cache_for_tree_diff()?;
7268

69+
let diff_algorithm = repo.diff_algorithm().expect("TODO");
70+
71+
let options = gix_blame::Options {
72+
diff_algorithm,
73+
range: None,
74+
since: None,
75+
};
76+
7377
let outcome = gix_blame::file(
7478
&repo.objects,
75-
traverse,
79+
tip.into(),
80+
cache,
7681
&mut resource_cache,
7782
file_path.into(),
78-
None,
83+
options,
7984
)?;
8085

8186
let commit_id = if let Some(commit_id) = commit_id {

0 commit comments

Comments
 (0)