Skip to content

Commit

Permalink
Clarify disable_pathspec_match docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Dec 18, 2024
1 parent 7db456d commit 9ae249f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ impl<'cb> CheckoutBuilder<'cb> {
self.flag(raw::GIT_CHECKOUT_CONFLICT_STYLE_DIFF3, on)
}

/// Treat paths as a simple list.
/// Treat paths specified in [`CheckoutBuilder::path`] as exact file paths
/// instead of as pathspecs.
pub fn disable_pathspec_match(&mut self, on: bool) -> &mut CheckoutBuilder<'cb> {
self.flag(raw::GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH, on)
}
Expand Down Expand Up @@ -520,8 +521,13 @@ impl<'cb> CheckoutBuilder<'cb> {

/// Add a path to be checked out.
///
/// The path is a [pathspec] pattern, unless
/// [`CheckoutBuilder::disable_pathspec_match`] is set.
///
/// If no paths are specified, then all files are checked out. Otherwise
/// only these specified paths are checked out.
///
/// [pathspec]: https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-aiddefpathspecapathspec
pub fn path<T: IntoCString>(&mut self, path: T) -> &mut CheckoutBuilder<'cb> {
let path = util::cstring_to_repo_path(path).unwrap();
self.path_ptrs.push(path.as_ptr());
Expand Down

0 comments on commit 9ae249f

Please sign in to comment.