1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #42515 from geaaru/permit-override-name

ReplaceFileTarWrapper: permit to override file name
This commit is contained in:
Sebastiaan van Stijn 2021-06-24 21:01:08 +02:00 committed by GitHub
commit 301be64d41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -278,7 +278,9 @@ func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]TarModi
return nil
}
header.Name = name
if header.Name == "" {
header.Name = name
}
header.Size = int64(len(data))
if err := tarWriter.WriteHeader(header); err != nil {
return err