Remove git-clang-format output when no files are modified
authorBrenden Blanco <bblanco@plumgrid.com>
Tue, 19 Apr 2016 18:15:05 +0000 (11:15 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Tue, 19 Apr 2016 18:15:05 +0000 (11:15 -0700)
scripts/git-clang-format

index 0c45762..359c836 100755 (executable)
@@ -135,9 +135,9 @@ def main():
       print 'Running clang-format on the following files:'
       for filename in changed_lines:
         print '   ', filename
-  if not changed_lines:
-    print 'no modified files to format'
-    return
+    else:
+      print 'no modified files to format'
+      return
   # The computed diff outputs absolute paths, so we must cd before accessing
   # those files.
   cd_to_toplevel()