Description
CopyMapper.map(..) calls targetStatus = targetFS.getFileStatus(target).
Few steps later RetriableFileCopyCommand.promoteTmpToTarget(..) will call again exists(target) and delete if present.
The second exists() is useless, since if targetStatus==null it can be easily seen if overwrite mode is activated and so target object can be deleted.
The propose of this patch is to delete target object by using targetStatus and thus avoid calling exists() method.