From 0a73d7d98ddede74b7ea2c40e67e2b7a2c6a5d2a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 10 Jan 2015 21:01:28 +0000 Subject: [PATCH] * don't delete files in test mode even if conflict override is specified --- source/net/filebot/cli/CmdlineOperations.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/cli/CmdlineOperations.java b/source/net/filebot/cli/CmdlineOperations.java index 714454fe..40627ca9 100644 --- a/source/net/filebot/cli/CmdlineOperations.java +++ b/source/net/filebot/cli/CmdlineOperations.java @@ -40,6 +40,7 @@ import net.filebot.HistorySpooler; import net.filebot.Language; import net.filebot.MediaTypes; import net.filebot.RenameAction; +import net.filebot.StandardRenameAction; import net.filebot.archive.Archive; import net.filebot.archive.FileMapper; import net.filebot.format.ExpressionFilter; @@ -618,7 +619,7 @@ public class CmdlineOperations implements CmdlineInterface { destination = new File(source.getParentFile(), destination.getPath()); } - if (!destination.equals(source) && destination.exists()) { + if (!destination.equals(source) && destination.exists() && renameAction != StandardRenameAction.TEST) { if (conflictAction == ConflictAction.FAIL) { throw new CmdlineException("File already exists: " + destination); } @@ -656,7 +657,7 @@ public class CmdlineOperations implements CmdlineInterface { } // write metadata into xattr if xattr is enabled - if (matches != null && (useExtendedFileAttributes() || useCreationDate())) { + if (matches != null && (useExtendedFileAttributes() || useCreationDate()) && renameAction != StandardRenameAction.TEST) { try { for (Match match : matches) { File file = match.getValue();