@@ -46,30 +46,19 @@ pub fn show(
46
46
}
47
47
let mut index = repo. index_or_empty ( ) ?;
48
48
let index = gix:: threading:: make_mut ( & mut index) ;
49
- let pathspec = repo. pathspec (
50
- pathspecs. iter ( ) . map ( |p| p. as_bstr ( ) ) ,
51
- true ,
52
- index,
53
- gix:: worktree:: stack:: state:: attributes:: Source :: WorktreeThenIdMapping ,
54
- ) ?;
55
49
let mut progress = progress. add_child ( "traverse index" ) ;
56
50
let start = std:: time:: Instant :: now ( ) ;
51
+ let stack = repo
52
+ . attributes_only (
53
+ index,
54
+ gix:: worktree:: stack:: state:: attributes:: Source :: WorktreeThenIdMapping ,
55
+ ) ?
56
+ . detach ( ) ;
57
+ let pathspec = gix:: Pathspec :: new ( & repo, pathspecs. iter ( ) . map ( |p| p. as_bstr ( ) ) , true , || Ok ( stack. clone ( ) ) ) ?;
57
58
let options = gix_status:: index_as_worktree:: Options {
58
59
fs : repo. filesystem_options ( ) ?,
59
60
thread_limit,
60
61
stat : repo. stat_options ( ) ?,
61
- attributes : match repo
62
- . attributes_only (
63
- index,
64
- gix:: worktree:: stack:: state:: attributes:: Source :: WorktreeThenIdMapping ,
65
- ) ?
66
- . detach ( )
67
- . state_mut ( )
68
- {
69
- gix:: worktree:: stack:: State :: AttributesStack ( attrs) => std:: mem:: take ( attrs) ,
70
- // TODO: this should be nicer by creating attributes directly, but it's a private API
71
- _ => unreachable ! ( "state must be attributes stack only" ) ,
72
- } ,
73
62
} ;
74
63
let mut printer = Printer {
75
64
out,
@@ -80,7 +69,12 @@ pub fn show(
80
69
. 0
81
70
. into_parts ( )
82
71
. 0 ;
83
-
72
+ let ctx = gix_status:: index_as_worktree:: Context {
73
+ pathspec : pathspec. into_parts ( ) . 0 ,
74
+ stack,
75
+ filter : filter_pipeline,
76
+ should_interrupt : & gix:: interrupt:: IS_INTERRUPTED ,
77
+ } ;
84
78
let mut collect = gix:: dir:: walk:: delegate:: Collect :: default ( ) ;
85
79
let ( outcome, walk_outcome) = gix:: features:: parallel:: threads ( |scope| -> anyhow:: Result < _ > {
86
80
// TODO: it's either this, or not running both in parallel and setting UPTODATE flags whereever
@@ -114,9 +108,7 @@ pub fn show(
114
108
Submodule ,
115
109
repo. objects . clone ( ) . into_arc ( ) ?,
116
110
& mut progress,
117
- pathspec. detach ( ) ?,
118
- filter_pipeline,
119
- & gix:: interrupt:: IS_INTERRUPTED ,
111
+ ctx,
120
112
options,
121
113
) ?;
122
114
0 commit comments