mirror of
https://github.com/NixOS/nix
synced 2025-06-30 07:33:16 +02:00
Misc code cleanups
This commit is contained in:
parent
c10dbdccac
commit
9db070d7a2
2 changed files with 39 additions and 64 deletions
|
@ -692,13 +692,12 @@ struct GitSourceAccessor : SourceAccessor
|
|||
const auto blob = getBlob(path, symlink);
|
||||
|
||||
if (lfsFetch) {
|
||||
auto pathStr = std::string(path.rel());
|
||||
if (lfsFetch->shouldFetch(pathStr)) {
|
||||
if (lfsFetch->shouldFetch(path)) {
|
||||
StringSink s;
|
||||
try {
|
||||
auto contents = std::string((const char *) git_blob_rawcontent(blob.get()), git_blob_rawsize(blob.get()));
|
||||
lfsFetch->fetch(contents, pathStr, s, [&s](uint64_t size){ s.s.reserve(size); });
|
||||
} catch (Error &e) {
|
||||
lfsFetch->fetch(contents, path, s, [&s](uint64_t size){ s.s.reserve(size); });
|
||||
} catch (Error & e) {
|
||||
e.addTrace({}, "while smudging git-lfs file '%s'", path);
|
||||
throw;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue