* don't allow file override so people can't mess up their stuff, but allow when src/dest path is the same, i.e. doesn't need any change, for usability reasons

This commit is contained in:
Reinhard Pointner 2013-04-13 06:14:38 +00:00
parent 41264f0045
commit fc8f6bc7ef
1 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,9 @@ class RenameAction extends AbstractAction {
if (destinationSet.contains(destination))
throw new IllegalArgumentException("Conflict detected: " + mapping.getValue().getPath());
if (destination.exists() && !resolveDestination(mapping.getKey(), mapping.getValue(), false).equals(mapping.getKey()))
throw new IllegalArgumentException("File already exists: " + mapping.getValue().getPath());
// use original mapping values
renameMap.put(mapping.getKey(), mapping.getValue());
destinationSet.add(destination);