Skip to content

Commit 3d33dfc

Browse files
committed
Set the Git fingerprint early
1 parent 8949fa2 commit 3d33dfc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/libfetchers/fetchers.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,10 @@ std::pair<ref<SourceAccessor>, Input> Input::getAccessorUnchecked(const Settings
358358
try {
359359
auto [accessor, result] = scheme->getAccessor(settings, store, *this);
360360

361-
if (!accessor->fingerprint)
362-
accessor->fingerprint = result.getFingerprint(store);
361+
if (auto fp = accessor->getFingerprint(CanonPath::root).second)
362+
result.cachedFingerprint = *fp;
363363
else
364-
result.cachedFingerprint = accessor->fingerprint;
364+
accessor->fingerprint = result.getFingerprint(store);
365365

366366
return {accessor, std::move(result)};
367367
} catch (Error & e) {

src/libfetchers/git-utils.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ struct GitSourceAccessor : SourceAccessor
766766
.options = options,
767767
}}
768768
{
769+
fingerprint = options.makeFingerprint(rev);
769770
}
770771

771772
std::string readBlob(const CanonPath & path, bool symlink)

0 commit comments

Comments
 (0)