fix: Prevent cleaning initialization path before creating root directory, add initialization tests
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user