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> {
491
491
self . flag ( raw:: GIT_CHECKOUT_CONFLICT_STYLE_DIFF3 , on)
492
492
}
493
493
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
+
494
500
/// Indicate whether to apply filters like CRLF conversion.
495
501
pub fn disable_filters ( & mut self , disable : bool ) -> & mut CheckoutBuilder < ' cb > {
496
502
self . disable_filters = disable;
@@ -515,8 +521,13 @@ impl<'cb> CheckoutBuilder<'cb> {
515
521
516
522
/// Add a path to be checked out.
517
523
///
524
+ /// The path is a [pathspec] pattern, unless
525
+ /// [`CheckoutBuilder::disable_pathspec_match`] is set.
526
+ ///
518
527
/// If no paths are specified, then all files are checked out. Otherwise
519
528
/// only these specified paths are checked out.
529
+ ///
530
+ /// [pathspec]: https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-aiddefpathspecapathspec
520
531
pub fn path < T : IntoCString > ( & mut self , path : T ) -> & mut CheckoutBuilder < ' cb > {
521
532
let path = util:: cstring_to_repo_path ( path) . unwrap ( ) ;
522
533
self . path_ptrs . push ( path. as_ptr ( ) ) ;
You can’t perform that action at this time.
0 commit comments