================
@@ -456,11 +461,23 @@ def extract_lines(patch_file):
     zero lines of context.  The return value is a dict mapping filename to a
     list of line `Range`s."""
     matches = {}
+
+    if whole_file:
----------------
eoineoineoin wrote:

The diff output from compute_diff() contains filenames relative to the root of 
the git repository. If the user runs `git clang-format` in a directory other 
than the root of the repository, those filenames don't exist relative to your 
$PWD, so we can't `open()` them to build the `Range` on lines 478,479.

This code gets the absolute path to the git repository so we can join it with 
those relative names, which makes the script invariant with respect to whatever 
directory it's run in.

https://github.com/llvm/llvm-project/pull/204336
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to