mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
archive: Always end directory filenames in tars with /
This matches what tar does, and without it the tarsum created by the registry will not match the docker one. Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
parent
bde2d3aef7
commit
f918fca3bf
1 changed files with 4 additions and 0 deletions
|
@ -145,6 +145,10 @@ func addTarFile(path, name string, tw *tar.Writer) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if fi.IsDir() && !strings.HasSuffix(name, "/") {
|
||||
name = name + "/"
|
||||
}
|
||||
|
||||
hdr.Name = name
|
||||
|
||||
stat, ok := fi.Sys().(*syscall.Stat_t)
|
||||
|
|
Loading…
Reference in a new issue