Don't reformat the source if the files are identical

If both sides are the same, there is no need to generate a
new PrettyFormatter with the file content.  We've already
pointed to the other file's existing formatting.

Change-Id: I7c75422a9e8dffccab8509b9c8d251886c0790a6
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-01-30 16:25:00 -08:00
parent d0145af034
commit 0e4f33b82f

View File

@@ -386,7 +386,7 @@ class PatchScriptBuilder {
displayMethod = DisplayMethod.NONE;
}
if (displayMethod == DisplayMethod.DIFF) {
if (!reuse && displayMethod == DisplayMethod.DIFF) {
PrettySettings s = new PrettySettings(settings.getPrettySettings());
s.setFileName(path);
s.setShowWhiteSpaceErrors(other != null /* side B */);