Skip to content

Commit 0f4f75b

Browse files
committed
doc: make tree-diff more easily discoverable when coming from git2
1 parent 3e590fa commit 0f4f75b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

gix/src/object/tree/diff/change.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub enum Event<'a, 'old, 'new> {
6161
entry_mode: gix_object::tree::EntryMode,
6262
/// The object id after the rename.
6363
id: Id<'new>,
64-
/// If true, this rewrite is created by copy, and `source_id` is pointing to its source. Otherwise it's a rename, and `source_id`
64+
/// If true, this rewrite is created by copy, and `source_id` is pointing to its source. Otherwise, it's a rename, and `source_id`
6565
/// points to a deleted object, as renames are tracked as deletions and additions of the same or similar content.
6666
copy: bool,
6767
},
@@ -70,8 +70,9 @@ pub enum Event<'a, 'old, 'new> {
7070
impl<'a, 'old, 'new> super::Change<'a, 'old, 'new> {
7171
/// Produce a platform for performing a line-diff no matter whether the underlying [Event] is an addition, modification,
7272
/// deletion or rewrite.
73-
/// Use `resource_cache` to store the diffable data and possibly reuse previously stored data.
74-
/// Afterwards the platform, which holds on to `resource_cache`, can be used to perform ready-made operations on the
73+
/// Use `resource_cache` to store the diffable data and possibly reuse previously stored data, usually obtained with
74+
/// [crate::Repository::diff_resource_cache()].
75+
/// Afterward the platform, which holds on to `resource_cache`, can be used to perform ready-made operations on the
7576
/// pre-set resources.
7677
///
7778
/// ### Warning about Memory Consumption

gix/src/object/tree/diff/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl<'repo> Tree<'repo> {
4040
/// try to access blobs to compute a similarity metric. Thus, it's more compatible to turn rewrite tracking off
4141
/// using [`Platform::track_rewrites()`].
4242
#[allow(clippy::result_large_err)]
43+
#[doc(alias = "diff_tree_to_tree", alias = "git2")]
4344
pub fn changes<'a>(&'a self) -> Result<Platform<'a, 'repo>, crate::diff::new_rewrites::Error> {
4445
Ok(Platform {
4546
state: Default::default(),

0 commit comments

Comments
 (0)