Ejemplo n.º 1
0
        void Command_Diff_Diff_VCSNormalFiles()
        {
            var files = GetSelectionStrings();

            if (files.Any(file => !File.Exists(file)))
            {
                throw new Exception("Selections must be files.");
            }

            var original       = files.Select(file => Versioner.GetUnmodifiedFile(file)).ToList();
            var invalidIndexes = original.Indexes(file => file == null);

            if (invalidIndexes.Any())
            {
                throw new Exception($"Unable to get unmodified files:\n{string.Join("\n", invalidIndexes.Select(index => files[index]))}");
            }

            var tabs = new Tabs();

            for (var ctr = 0; ctr < files.Count; ctr++)
            {
                tabs.AddDiff(displayName1: Path.GetFileName(files[ctr]), modified1: false, bytes1: original[ctr], fileName2: files[ctr]);
            }
        }