File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,12 @@ impl<'cb> CheckoutBuilder<'cb> {
491491 self . flag ( raw:: GIT_CHECKOUT_CONFLICT_STYLE_DIFF3 , on)
492492 }
493493
494+ /// Treat paths specified in [`CheckoutBuilder::path`] as exact file paths
495+ /// instead of as pathspecs.
496+ pub fn disable_pathspec_match ( & mut self , on : bool ) -> & mut CheckoutBuilder < ' cb > {
497+ self . flag ( raw:: GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH , on)
498+ }
499+
494500 /// Indicate whether to apply filters like CRLF conversion.
495501 pub fn disable_filters ( & mut self , disable : bool ) -> & mut CheckoutBuilder < ' cb > {
496502 self . disable_filters = disable;
@@ -515,8 +521,13 @@ impl<'cb> CheckoutBuilder<'cb> {
515521
516522 /// Add a path to be checked out.
517523 ///
524+ /// The path is a [pathspec] pattern, unless
525+ /// [`CheckoutBuilder::disable_pathspec_match`] is set.
526+ ///
518527 /// If no paths are specified, then all files are checked out. Otherwise
519528 /// only these specified paths are checked out.
529+ ///
530+ /// [pathspec]: https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-aiddefpathspecapathspec
520531 pub fn path < T : IntoCString > ( & mut self , path : T ) -> & mut CheckoutBuilder < ' cb > {
521532 let path = util:: cstring_to_repo_path ( path) . unwrap ( ) ;
522533 self . path_ptrs . push ( path. as_ptr ( ) ) ;
You can’t perform that action at this time.
0 commit comments