fix: Prevent cleaning initialization path before creating root directory, add initialization tests

This commit is contained in:
Felicitas Pojtinger
2022-01-10 23:28:45 +01:00
parent 7b83d3bc20
commit 2487479433
11 changed files with 231 additions and 94 deletions

View File

@@ -29,6 +29,7 @@ func (o *Operations) Archive(
getSrc func() (config.FileConfig, error),
compressionLevel string,
overwrite bool,
initializing bool,
) ([]*tar.Header, error) {
o.diskOperationLock.Lock()
defer o.diskOperationLock.Unlock()
@@ -277,6 +278,7 @@ func (o *Operations) Archive(
int(lastIndexedRecord),
int(lastIndexedBlock),
overwrite,
initializing,
index,
func(hdr *tar.Header, i int) error {

View File

@@ -125,6 +125,7 @@ func (o *Operations) Delete(name string) error {
int(lastIndexedRecord),
int(lastIndexedBlock),
false,
false,
1, // Ignore the first header, which is the last header which we already indexed
func(hdr *tar.Header, i int) error {

View File

@@ -144,6 +144,7 @@ func (o *Operations) Move(from string, to string) error {
int(lastIndexedRecord),
int(lastIndexedBlock),
false,
false,
1, // Ignore the first header, which is the last header which we already indexed
func(hdr *tar.Header, i int) error {

View File

@@ -305,6 +305,7 @@ func (o *Operations) Update(
int(lastIndexedRecord),
int(lastIndexedBlock),
false,
false,
1, // Ignore the first header, which is the last header which we already indexed
func(hdr *tar.Header, i int) error {