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

force the read of the tarSum so that sums actually get computed

Docker-DCO-1.1-Signed-off-by: Brice Jaglin <bjaglin@teads.tv> (github: bjaglin)
This commit is contained in:
Brice Jaglin 2014-05-19 23:24:33 +02:00 committed by Victor Vieux
parent a16cb394fa
commit 9810da853b

View file

@ -571,6 +571,9 @@ func (b *buildFile) CmdAdd(args string) error {
return err
}
tarSum := utils.TarSum{Reader: r, DisableCompression: true}
if _, err := io.Copy(ioutil.Discard, &tarSum); err != nil {
return err
}
remoteHash = tarSum.Sum(nil)
r.Close()