Merge pull request #33956 from keloyang/fix-cp-with-hardlink
Fix docker cp dir with hard link Upstream-commit: 9789530b46f36e2961113949f117f93c1fd4e60c Component: engine
This commit is contained in:
@ -332,6 +332,9 @@ func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.Read
|
||||
}
|
||||
|
||||
hdr.Name = strings.Replace(hdr.Name, oldBase, newBase, 1)
|
||||
if hdr.Typeflag == tar.TypeLink {
|
||||
hdr.Linkname = strings.Replace(hdr.Linkname, oldBase, newBase, 1)
|
||||
}
|
||||
|
||||
if err = rebasedTar.WriteHeader(hdr); err != nil {
|
||||
w.CloseWithError(err)
|
||||
|
||||
Reference in New Issue
Block a user