Open stephenhines opened 4 years ago
Fixed by 0fd0a010a1ed2ce761d20bfc6378e5bbaa75c8de (https://reviews.llvm.org/D101878).
To reproduce:
foo.h
and commit it to a git projectThis'd suggest a formatting change to the foo.h.
https://reviews.llvm.org/D101878 has a proposed fix.
assigned to @pirama-arumuga-nainar
It seems this was fixed only for git-clang-format
. If you run clang-format -i
on a symlink, it still seems replace the symlink with a regular file. I would expect it to either replace the file the symlink points to, or to skip the symlink.
Can this issue be reopened?
Extended Description
This comes from an Android bug about running clang-format on a symlinked file (in this case, one named DisplayId.h that is pointing to a different DisplayId.h).
diff --git a/libs/ui/include_vndk/ui/DisplayId.h b/libs/ui/include_vndk/ui/DisplayId.h index 73c9fe8d689..ec31ce4a306 120000 --- a/libs/ui/include_vndk/ui/DisplayId.h +++ b/libs/ui/include_vndk/ui/DisplayId.h @@ -1 +1 @@ -../../include/ui/DisplayId.h \ No newline at end of file +../../ include / ui / DisplayId.h \ No newline at end of file
Ideally, clang-format would detect that it is running on a symlink and not adjust the file at all.