ppkarwasz commented on code in PR #458:
URL: https://github.com/apache/commons-codec/pull/458#discussion_r4654260285


##########
src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java:
##########
@@ -211,18 +223,26 @@ public enum FileMode {
          */
         SYMBOLIC_LINK(new byte[] { '1', '2', '0', '0', '0', '0' });
 
-        private static FileMode get(final Path path) {
-            // Symbolic links first
-            if (Files.isSymbolicLink(path)) {
+        private static FileMode get(final Path path) throws IOException {
+            // Read one attribute set, preferring POSIX where the file system 
provides it. The basic view always exists and
+            // classifies links and directories; only POSIX permissions carry 
the owner-execute bit that Git records. Git
+            // records the executable bit only where the file system exposes 
POSIX permissions; elsewhere, for example with
+            // Git for Windows and its default core.fileMode=false, regular 
files are stored as 100644 even though Windows
+            // reports every readable file as executable.

Review Comment:
   _Nit_: I think the code is self-explaining, so this comment could be 
dropped. LLMs have the tendency of writing the history of their life as 
comments, but IMHO most of them are not necessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to