diff --git a/internal/walker/rewriter.go b/internal/walker/rewriter.go index 9e380733a..91a5c9190 100644 --- a/internal/walker/rewriter.go +++ b/internal/walker/rewriter.go @@ -161,14 +161,11 @@ func (t *TreeRewriter) RewriteTree(ctx context.Context, repo BlobLoadSaver, node } countInserts++ } - } else { - countInserts = 1 - } - - // check for empty node list - if t.opts.KeepEmptyDirecoryGlobal && countInserts == 0 { - // current subdirectory is empty - due to no includes: create condition here - return restic.ID{}, nil + // check for empty node list + if t.opts.KeepEmptyDirecoryGlobal && countInserts == 0 { + // current subdirectory is empty - due to no includes: create condition here + return restic.ID{}, nil + } } tree, err := tb.Finalize()