From 1066fb7d44f1063d45937203f8c6b10431d5ba96 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 7 Aug 2024 15:52:48 +0100 Subject: [PATCH] don't fetch from store to store --- src/libfetchers/fetch-to-store.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libfetchers/fetch-to-store.cc b/src/libfetchers/fetch-to-store.cc index 65aa72a6c36a..0c55a1d2ac78 100644 --- a/src/libfetchers/fetch-to-store.cc +++ b/src/libfetchers/fetch-to-store.cc @@ -15,6 +15,9 @@ StorePath fetchToStore( { // FIXME: add an optimisation for the case where the accessor is // a `PosixSourceAccessor` pointing to a store path. + if (store.isInStore(path.path.abs())) { + return store.toStorePath(path.path.abs()).first; + } std::optional cacheKey;