MCPcopy Index your code
hub / github.com/cli/cli / entryTypeFromMode

Function entryTypeFromMode

pkg/cmd/repo/read-dir/http.go:226–239  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

224// command reports: dir, file, symlink, or submodule. Modes with an unrecognized
225// type are reported as "unknown".
226func 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}

Callers 2

fetchTreeFunction · 0.85
Test_entryTypeFromModeFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_entryTypeFromModeFunction · 0.68