| Index: pkg/analyzer/bin/formatter.dart
|
| ===================================================================
|
| --- pkg/analyzer/bin/formatter.dart (revision 31858)
|
| +++ pkg/analyzer/bin/formatter.dart (working copy)
|
| @@ -113,7 +113,10 @@
|
| var rawSource = file.readAsStringSync();
|
| var formatted = _format(rawSource, CodeKind.COMPILATION_UNIT);
|
| if (overwriteFileContents) {
|
| - file.writeAsStringSync(formatted);
|
| + // Only touch files files whose contents will be changed
|
| + if (rawSource != formatted) {
|
| + file.writeAsStringSync(formatted);
|
| + }
|
| } else {
|
| print(formatted);
|
| }
|
|
|