Skip to content

Commit d458a08

Browse files
committed
TreeUpdateBuilder/TreeBuilder: Document and cross-reference
Signed-off-by: Ian Jackson <[email protected]>
1 parent 083a74f commit d458a08

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ pub type RemoteCreate<'cb> =
6565
dyn for<'a> FnMut(&'a Repository, &str, &str) -> Result<Remote<'a>, Error> + 'cb;
6666

6767
/// A builder struct for git tree updates.
68+
///
69+
/// Paths passed to `remove` and `upsert` can be multi-component paths, ie they
70+
/// may contain slashes.
71+
///
72+
/// This is the more-cooked tree update facility. There is also [`TreeBuilder`]
73+
/// which is lower-level (and operates only on one level of the tree at a time).
74+
///
75+
/// [`TreeBuilder`]: crate::TreeBuilder
6876
pub struct TreeUpdateBuilder {
6977
updates: Vec<raw::git_tree_update>,
7078
paths: Vec<CString>,

src/treebuilder.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ use libc::{c_int, c_void};
66
use crate::util::{Binding, IntoCString};
77
use crate::{panic, raw, tree, Error, Oid, Repository, TreeEntry};
88

9-
/// Constructor for in-memory trees
9+
/// Constructor for in-memory trees (low-level)
10+
///
11+
/// You probably want to use [`build::TreeUpdateBuilder`] instead.
12+
///
13+
/// This is the more raw of the two tree update facilities. It
14+
/// handles only one level of a nested tree structure at a time. Each
15+
/// path passed to `insert` etc. must be a single component.
16+
///
17+
/// [`build::TreeUpdateBuilder`]: crate::build::TreeUpdateBuilder
1018
pub struct TreeBuilder<'repo> {
1119
raw: *mut raw::git_treebuilder,
1220
_marker: marker::PhantomData<&'repo Repository>,

0 commit comments

Comments
 (0)