Skip to content

Commit 6c6f946

Browse files
committed
feat: add Repository::diff_resource_cache_for_tree_diff()
1 parent cdaba84 commit 6c6f946

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gix/src/repository/diff.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,14 @@ impl Repository {
4949
worktree_roots,
5050
)?)
5151
}
52+
53+
/// Return a resource cache suitable for diffing blobs from trees directly, where no worktree checkout exists.
54+
///
55+
/// For more control, see [`diff_resource_cache()`](Self::diff_resource_cache).
56+
pub fn diff_resource_cache_for_tree_diff(&self) -> Result<gix_diff::blob::Platform, resource_cache::Error> {
57+
self.diff_resource_cache(
58+
gix_diff::blob::pipeline::Mode::ToGit,
59+
gix_diff::blob::pipeline::WorktreeRoots::default(),
60+
)
61+
}
5262
}

0 commit comments

Comments
 (0)