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:
Alexander Larsson 2014-01-21 12:52:05 +01:00
Родитель bde2d3aef7
Коммит f918fca3bf
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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)