MCPcopy Create free account
hub / github.com/NixOS/nix / parseObjectType

Function parseObjectType

src/libutil/git.cc:161–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161ObjectType parseObjectType(Source & source, const ExperimentalFeatureSettings & xpSettings)
162{
163 xpSettings.require(Xp::GitHashing);
164
165 auto type = getString(source, 5);
166
167 if (type == "blob ") {
168 return ObjectType::Blob;
169 } else if (type == "tree ") {
170 return ObjectType::Tree;
171 } else
172 throw Error("input doesn't look like a Git object");
173}
174
175void parse(
176 FileSystemObjectSink & sink,

Callers 3

parseFunction · 0.85
TEST_FFunction · 0.85
mkTreeReadTestFunction · 0.85

Calls 3

getStringFunction · 0.85
ErrorEnum · 0.85
requireMethod · 0.45

Tested by

no test coverage detected