[PATCH] D129311: [clang-format] Update return code

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 17:23:33 PDT 2022


owenpan added a comment.

Please mark as done if you have addressed an inline comment.



================
Comment at: clang/tools/clang-format/git-clang-format:539-540
   # filter.
-  subprocess.check_call(['git', 'diff', '--diff-filter=M', old_tree, new_tree,
-                         '--'])
+  return subprocess.run(['git', 'diff', '--diff-filter=M',
+                         old_tree, new_tree, '--exit-code', '--']).returncode
 
----------------
Omit `--exit-code` (if implied) and fix the location of `--`.


================
Comment at: clang/tools/clang-format/git-clang-format:551-558
+  return subprocess.run(['git',
+                         'diff',
+                         '--diff-filter=M',
+                         '--stat',
+                         old_tree,
+                         new_tree,
+                         '--exit-code',
----------------
Ditto.


================
Comment at: clang/tools/clang-format/git-clang-format:584
     with temporary_index_file(old_tree):
       subprocess.check_call(['git', 'checkout', '--patch', new_tree])
     index_tree = old_tree
----------------
While we are at it, let's also replace this one with `run()`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129311/new/

https://reviews.llvm.org/D129311



More information about the cfe-commits mailing list