From 0e4f33b82fe61e65cc40d4cebdf48ddcfa56f8d7 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 30 Jan 2010 16:25:00 -0800 Subject: [PATCH] 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 --- .../com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java index 753c6fcba9..971c5f6776 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java @@ -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 */);