File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -145,16 +145,25 @@ pub struct TestWorkspace {
145
145
146
146
impl TestWorkspace {
147
147
pub fn init ( settings : & UserSettings , use_git : bool ) -> Self {
148
+ let backend = if use_git {
149
+ TestRepoBackend :: Git
150
+ } else {
151
+ TestRepoBackend :: Local
152
+ } ;
153
+ Self :: init_with_backend ( settings, backend)
154
+ }
155
+
156
+ pub fn init_with_backend ( settings : & UserSettings , backend : TestRepoBackend ) -> Self {
148
157
let temp_dir = new_temp_dir ( ) ;
149
158
150
159
let workspace_root = temp_dir. path ( ) . join ( "repo" ) ;
151
160
fs:: create_dir ( & workspace_root) . unwrap ( ) ;
152
161
153
- let ( workspace, repo) = if use_git {
154
- Workspace :: init_internal_git ( settings, & workspace_root) . unwrap ( )
155
- } else {
156
- Workspace :: init_local ( settings , & workspace_root ) . unwrap ( )
157
- } ;
162
+ let ( workspace, repo) =
163
+ Workspace :: init_with_backend ( settings, & workspace_root, |store_path| {
164
+ backend . init_backend ( store_path )
165
+ } )
166
+ . unwrap ( ) ;
158
167
159
168
Self {
160
169
temp_dir,
You can’t perform that action at this time.
0 commit comments