Skip to content

Improve docs and xrefs re tree building #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ pub struct RepoBuilder<'cb> {
pub type RemoteCreate<'cb> =
dyn for<'a> FnMut(&'a Repository, &str, &str) -> Result<Remote<'a>, Error> + 'cb;

/// A builder struct for git tree updates, for use with `git_tree_create_updated`.
/// A builder struct for git tree updates.
///
/// Paths passed to `remove` and `upsert` can be multi-component paths, i.e. they
/// may contain slashes.
///
/// This is a higher-level tree update facility. There is also [`TreeBuilder`]
/// which is lower-level (and operates only on one level of the tree at a time).
///
/// [`TreeBuilder`]: crate::TreeBuilder
pub struct TreeUpdateBuilder {
updates: Vec<raw::git_tree_update>,
paths: Vec<CString>,
Expand Down
10 changes: 9 additions & 1 deletion src/treebuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ use libc::{c_int, c_void};
use crate::util::{Binding, IntoCString};
use crate::{panic, raw, tree, Error, Oid, Repository, TreeEntry};

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