mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
rewriter.go: rectify logic error while processing empty subdirectories
KeepEmptyDirecoryGlobal was previosly a negated bool variable and the negation was not taken away.
This commit is contained in:
parent
f6e0dac1ad
commit
fa3534da52
1 changed files with 2 additions and 3 deletions
|
@ -41,7 +41,6 @@ func NewTreeRewriter(opts RewriteOpts) *TreeRewriter {
|
|||
rw := &TreeRewriter{
|
||||
opts: opts,
|
||||
}
|
||||
rw.opts.KeepEmptyDirecoryGlobal = true
|
||||
|
||||
if !opts.DisableNodeCache {
|
||||
rw.replaces = make(idMap)
|
||||
|
@ -154,7 +153,7 @@ func (t *TreeRewriter) RewriteTree(ctx context.Context, repo BlobLoadSaver, node
|
|||
}
|
||||
|
||||
// check for empty subtree condition here
|
||||
if !t.opts.KeepEmptyDirecoryGlobal && err == nil && newID.IsNull() {
|
||||
if t.opts.KeepEmptyDirecoryGlobal && err == nil && newID.IsNull() {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -167,7 +166,7 @@ func (t *TreeRewriter) RewriteTree(ctx context.Context, repo BlobLoadSaver, node
|
|||
}
|
||||
|
||||
// check for empty node list
|
||||
if !t.opts.KeepEmptyDirecoryGlobal && countInserts == 0 {
|
||||
if t.opts.KeepEmptyDirecoryGlobal && countInserts == 0 {
|
||||
// current subdirectory is empty - due to no includes: create condition here
|
||||
return restic.ID{}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue