[PATCH] D130108: git-clang-format: format index not worktree when using --staged

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 16:09:16 PDT 2022


owenpan accepted this revision.
owenpan added a comment.
This revision is now accepted and ready to land.

Please mark review comments as done if you have addressed them.



================
Comment at: clang/tools/clang-format/git-clang-format:401
+  # Copy the environment, because the files have to be read from the original
+  # index
+  env = os.environ.copy()
----------------
Nit: end the sentence with a period as previously suggested.


================
Comment at: clang/tools/clang-format/git-clang-format:419-420
   Returns the object ID (SHA-1) of the created tree."""
+  # Copy the environment when formatting the files in the index, because the 
+  # files have to be read from the original index
+  env = os.environ.copy() if revision == '' else None
----------------
Nit: extraneous trailing whitespace and lack of a full stop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130108



More information about the cfe-commits mailing list