aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/git.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-15 14:33:31 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-02-16 11:14:01 +0100
commitaa5b83d93ce1b7bb67bf81ceda7ebf7706b1efa0 (patch)
tree95d60471883b8f865a0a0b9961eb6161b9b1d2ac /src/libfetchers/git.cc
parent2d6d9a28ebb17b1ba1fe0dc4d56b6aa311f94d39 (diff)
InputScheme::fetch(): Return a StorePath instead of a Tree
Diffstat (limited to 'src/libfetchers/git.cc')
-rw-r--r--src/libfetchers/git.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc
index 544d2ffbf..c3f0f8c8f 100644
--- a/src/libfetchers/git.cc
+++ b/src/libfetchers/git.cc
@@ -172,7 +172,7 @@ struct GitInputScheme : InputScheme
return {isLocal, isLocal ? url.path : url.base};
}
- std::pair<Tree, Input> fetch(ref<Store> store, const Input & _input) override
+ std::pair<StorePath, Input> fetch(ref<Store> store, const Input & _input) override
{
Input input(_input);
@@ -197,17 +197,14 @@ struct GitInputScheme : InputScheme
};
auto makeResult = [&](const Attrs & infoAttrs, StorePath && storePath)
- -> std::pair<Tree, Input>
+ -> std::pair<StorePath, Input>
{
assert(input.getRev());
assert(!_input.getRev() || _input.getRev() == input.getRev());
if (!shallow)
input.attrs.insert_or_assign("revCount", getIntAttr(infoAttrs, "revCount"));
input.attrs.insert_or_assign("lastModified", getIntAttr(infoAttrs, "lastModified"));
- return {
- Tree(store->toRealPath(storePath), std::move(storePath)),
- input
- };
+ return {std::move(storePath), input};
};
if (input.getRev()) {
@@ -285,10 +282,7 @@ struct GitInputScheme : InputScheme
"lastModified",
haveCommits ? std::stoull(runProgram("git", true, { "-C", actualUrl, "log", "-1", "--format=%ct", "--no-show-signature", "HEAD" })) : 0);
- return {
- Tree(store->toRealPath(storePath), std::move(storePath)),
- input
- };
+ return {std::move(storePath), input};
}
}