mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-25 07:50:52 +01:00
Fix import of exports without queryable store data
This commit is contained in:
committed by
Thomas Zerr
parent
fbd78ab7e1
commit
4a767d3886
2
gradle/changelog/import.yaml
Normal file
2
gradle/changelog/import.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Import of repository exports without queryable store data
|
||||
@@ -101,7 +101,8 @@ public class RepositoryQueryableStoreExporter {
|
||||
try {
|
||||
File dataDir = new File(workdir, "queryable-store-data");
|
||||
if (!dataDir.exists() || !dataDir.isDirectory()) {
|
||||
throw new RuntimeException("Directory 'queryable-store-data' not found in workdir: " + workdir.getAbsolutePath());
|
||||
log.trace("missing directory {} - skipping import of queryable data", dataDir.getAbsolutePath());
|
||||
return;
|
||||
}
|
||||
|
||||
JAXBContext jaxbContext = JAXBContext.newInstance(StoreExport.class);
|
||||
|
||||
@@ -175,5 +175,14 @@ class RepositoryQueryableStoreExporterTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldSkipImportIfDirectoryIsMissing(SimpleTypeStoreFactory simpleTypeStoreFactory, @TempDir File tempDir) throws IOException {
|
||||
exporter.importStores("42", tempDir);
|
||||
|
||||
try (QueryableMutableStore<SimpleType> store = simpleTypeStoreFactory.getMutable("42")) {
|
||||
assertThat(store.getAll()).hasSize(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user