entryTypeFromMode normalizes a git object mode into the entry type names the command reports: dir, file, symlink, or submodule. Modes with an unrecognized type are reported as "unknown".
(mode int)
| 224 | // command reports: dir, file, symlink, or submodule. Modes with an unrecognized |
| 225 | // type are reported as "unknown". |
| 226 | func entryTypeFromMode(mode int) string { |
| 227 | switch mode & modeTypeMask { |
| 228 | case modeDir: |
| 229 | return "dir" |
| 230 | case modeFile: |
| 231 | return "file" |
| 232 | case modeSymlink: |
| 233 | return "symlink" |
| 234 | case modeSubmodule: |
| 235 | return "submodule" |
| 236 | default: |
| 237 | return "unknown" |
| 238 | } |
| 239 | } |
no outgoing calls