File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,7 @@ pub mod main_worktree {
118
118
} ) ?;
119
119
let mut index = gix_index:: File :: from_state ( index, repo. index_path ( ) ) ;
120
120
121
- let mut opts = repo
122
- . config
123
- . checkout_options ( repo, gix_worktree:: stack:: state:: attributes:: Source :: IdMapping ) ?;
121
+ let mut opts = repo. checkout_options ( gix_worktree:: stack:: state:: attributes:: Source :: IdMapping ) ?;
124
122
opts. destination_is_initially_empty = true ;
125
123
126
124
let mut files = progress. add_child_with_id ( "checkout" . to_string ( ) , ProgressId :: CheckoutFiles . into ( ) ) ;
Original file line number Diff line number Diff line change
1
+ use crate :: { config, Repository } ;
2
+
3
+ impl Repository {
4
+ /// Return options that can be used to drive a low-level checkout operation.
5
+ /// Use `attributes_source` to determine where `.gitattributes` files should be read from, which depends on
6
+ /// the presence of a worktree to begin with.
7
+ /// Here, typically this value would be [`gix_worktree::stack::state::attributes::Source::IdMapping`]
8
+ pub fn checkout_options (
9
+ & self ,
10
+ attributes_source : gix_worktree:: stack:: state:: attributes:: Source ,
11
+ ) -> Result < gix_worktree_state:: checkout:: Options , config:: checkout_options:: Error > {
12
+ self . config . checkout_options ( self , attributes_source)
13
+ }
14
+ }
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ pub enum Kind {
20
20
#[ cfg( any( feature = "attributes" , feature = "excludes" ) ) ]
21
21
pub mod attributes;
22
22
mod cache;
23
+ #[ cfg( feature = "worktree-mutation" ) ]
24
+ mod checkout;
23
25
mod config;
26
+
24
27
///
25
28
#[ cfg( feature = "blob-diff" ) ]
26
29
mod diff;
You can’t perform that action at this time.
0 commit comments