Fix duplicate directories entries on metadata change

Currently directory changes are not added to the list of
included directories, allowing those directories to receive
duplicate entries where there is both a metadata change to the
directory and a change to a file under that directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2018-01-24 14:26:14 -08:00
parent 8d32d9edfc
commit dfadd8ce75
2 changed files with 53 additions and 1 deletions

View File

@@ -583,6 +583,9 @@ func (cw *changeWriter) includeParents(hdr *tar.Header) error {
}
}
}
if hdr.Typeflag == tar.TypeDir {
cw.addedDirs[name] = struct{}{}
}
return nil
}