@@ -311,9 +311,13 @@ impl RemoteConfig {
311
311
inner,
312
312
} = self ;
313
313
let mut handle: storage:: RepositoryHandle = match inner. clone ( ) {
314
- RepositoryConfig :: Fs ( config) => storage:: fs:: MaybeOpenFsRepository :: from_config ( config)
315
- . await ?
316
- . into ( ) ,
314
+ // Remote repositories never have a render store (from our
315
+ // perspective).
316
+ RepositoryConfig :: Fs ( config) => <storage:: fs:: MaybeOpenFsRepository <
317
+ storage:: fs:: NoRenderStore ,
318
+ > as Into < storage:: RepositoryHandle > >:: into (
319
+ storage:: fs:: MaybeOpenFsRepository :: from_config ( config) . await ?,
320
+ ) ,
317
321
RepositoryConfig :: Tar ( config) => storage:: tar:: TarRepository :: from_config ( config)
318
322
. await ?
319
323
. into ( ) ,
@@ -532,7 +536,12 @@ impl Config {
532
536
}
533
537
534
538
/// Get the local repository instance as configured, creating it if needed.
535
- pub async fn get_opened_local_repository ( & self ) -> Result < storage:: fs:: OpenFsRepository > {
539
+ pub async fn get_opened_local_repository < RS > ( & self ) -> Result < storage:: fs:: OpenFsRepository < RS > >
540
+ where
541
+ RS : storage:: DefaultRenderStoreCreationPolicy
542
+ + storage:: RenderStoreForUser < RenderStore = RS >
543
+ + Clone ,
544
+ {
536
545
// Possibly use a different path for the local repository, depending
537
546
// on enabled features.
538
547
#[ allow( unused_mut) ]
@@ -544,7 +553,7 @@ impl Config {
544
553
Some ( self . storage . root . join ( "ci" ) . join ( format ! ( "pipeline_{id}" ) ) ) ;
545
554
}
546
555
547
- let mut local_repo = storage:: fs:: OpenFsRepository :: create (
556
+ let mut local_repo = storage:: fs:: OpenFsRepository :: < RS > :: create (
548
557
use_ci_isolated_storage_path
549
558
. as_ref ( )
550
559
. unwrap_or ( & self . storage . root ) ,
@@ -565,16 +574,24 @@ impl Config {
565
574
///
566
575
/// The returned repo is guaranteed to be created, valid and open already. Ie
567
576
/// the local repository is not allowed to be lazily opened.
568
- pub async fn get_local_repository ( & self ) -> Result < storage:: fs:: OpenFsRepository > {
577
+ pub async fn get_local_repository < RS > ( & self ) -> Result < storage:: fs:: OpenFsRepository < RS > >
578
+ where
579
+ RS : storage:: DefaultRenderStoreCreationPolicy
580
+ + storage:: RenderStoreForUser < RenderStore = RS >
581
+ + Clone ,
582
+ {
569
583
self . get_opened_local_repository ( ) . await . map ( Into :: into)
570
584
}
571
585
572
- /// Get the local repository handle as configured, creating it if needed.
586
+ /// Get the local repository handle as configured, creating it if needed.
573
587
///
574
588
/// The returned repo is guaranteed to be created, valid and open already. Ie
575
589
/// the local repository is not allowed to be lazily opened.
576
590
pub async fn get_local_repository_handle ( & self ) -> Result < storage:: RepositoryHandle > {
577
- Ok ( self . get_local_repository ( ) . await ?. into ( ) )
591
+ Ok ( self
592
+ . get_local_repository :: < storage:: fs:: MaybeRenderStore > ( )
593
+ . await ?
594
+ . into ( ) )
578
595
}
579
596
580
597
/// Get a remote repository by name, or the local repository.
@@ -590,14 +607,18 @@ impl Config {
590
607
{
591
608
match name {
592
609
Some ( name) => self . get_remote ( name) . await ,
593
- None => Ok ( self . get_local_repository ( ) . await ?. into ( ) ) ,
610
+ None => Ok ( self
611
+ . get_local_repository :: < storage:: fs:: MaybeRenderStore > ( )
612
+ . await ?
613
+ . into ( ) ) ,
594
614
}
595
615
}
596
616
597
617
/// Get the local runtime storage, as configured.
598
618
pub async fn get_runtime_storage ( & self ) -> Result < runtime:: Storage > {
599
619
runtime:: Storage :: new ( storage:: RepositoryHandle :: from (
600
- self . get_local_repository ( ) . await ?,
620
+ self . get_local_repository :: < storage:: fs:: MaybeRenderStore > ( )
621
+ . await ?,
601
622
) )
602
623
}
603
624
0 commit comments