diff --git a/src/DiffEngine/DiffRunner.cs b/src/DiffEngine/DiffRunner.cs index c48db96f64..9b755b9a62 100644 --- a/src/DiffEngine/DiffRunner.cs +++ b/src/DiffEngine/DiffRunner.cs @@ -43,7 +43,7 @@ public static void Kill(string tempFile, string targetFile) public static LaunchResult Launch(DiffTool tool, string tempFile, string targetFile) { - Guard.AgainstNullOrEmpty(tempFile, nameof(tempFile)); + Guard.FileExists(tempFile, nameof(tempFile)); Guard.AgainstNullOrEmpty(targetFile, nameof(targetFile)); var extension = Extensions.GetExtension(tempFile); if (!DiffTools.TryFind(tool, extension, out var resolvedTool)) @@ -59,7 +59,7 @@ public static LaunchResult Launch(DiffTool tool, string tempFile, string targetF /// public static LaunchResult Launch(string tempFile, string targetFile) { - Guard.AgainstNullOrEmpty(tempFile, nameof(tempFile)); + Guard.FileExists(tempFile, nameof(tempFile)); Guard.AgainstNullOrEmpty(targetFile, nameof(targetFile)); var extension = Extensions.GetExtension(tempFile); @@ -77,14 +77,6 @@ static LaunchResult Launch(ResolvedDiffTool diffTool, string tempFile, string ta { return LaunchResult.TooManyRunningDiffTools; } - //TODO: throw if both dont exist - if (!File.Exists(tempFile)) - { - if (!AllFiles.TryCreateFile(tempFile, true)) - { - return LaunchResult.NoEmptyFileForExtension; - } - } if (!File.Exists(targetFile)) {