Fixed a bug which caused 'docker cp' to fail when the destination name already exists.
This commit is contained in:
parent
d8a4910eee
commit
49da84d7c4
|
@ -141,9 +141,6 @@ func (index *Index) Copy(srcNameOrId, dstName string) (*Image, error) {
|
||||||
if src == nil {
|
if src == nil {
|
||||||
return nil, errors.New("No such image: " + srcNameOrId)
|
return nil, errors.New("No such image: " + srcNameOrId)
|
||||||
}
|
}
|
||||||
if index.Find(dstName) != nil {
|
|
||||||
return nil, errors.New(dstName + ": image already exists.")
|
|
||||||
}
|
|
||||||
dst, err := NewImage(dstName, src.Layers, src.Id)
|
dst, err := NewImage(dstName, src.Layers, src.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue