1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Don't fingerprint dirty repos with submodules for now

Fixes nixpkgsLibTests.
This commit is contained in:
Eelco Dolstra 2024-12-03 15:50:39 +01:00
parent 331bf3e261
commit d044a05197

View file

@ -15,6 +15,7 @@
#include "finally.hh" #include "finally.hh"
#include "fetch-settings.hh" #include "fetch-settings.hh"
#include "json-utils.hh" #include "json-utils.hh"
#include "archive.hh"
#include <regex> #include <regex>
#include <string.h> #include <string.h>
@ -802,7 +803,7 @@ struct GitInputScheme : InputScheme
return makeFingerprint(*rev); return makeFingerprint(*rev);
else { else {
auto repoInfo = getRepoInfo(input); auto repoInfo = getRepoInfo(input);
if (repoInfo.isLocal && repoInfo.workdirInfo.headRev) { if (repoInfo.isLocal && repoInfo.workdirInfo.headRev && repoInfo.workdirInfo.submodules.empty()) {
/* Calculate a fingerprint that takes into account the /* Calculate a fingerprint that takes into account the
deleted and modified/added files. */ deleted and modified/added files. */
HashSink hashSink{HashAlgorithm::SHA512}; HashSink hashSink{HashAlgorithm::SHA512};
@ -810,7 +811,7 @@ struct GitInputScheme : InputScheme
if (file.second == GitRepo::WorkdirInfo::State::Dirty) { if (file.second == GitRepo::WorkdirInfo::State::Dirty) {
writeString("modified:", hashSink); writeString("modified:", hashSink);
writeString(file.first.abs(), hashSink); writeString(file.first.abs(), hashSink);
readFile(std::filesystem::path(repoInfo.url) + file.first.abs(), hashSink); dumpPath(repoInfo.url + "/" + file.first.abs(), hashSink);
} }
for (auto & file : repoInfo.workdirInfo.deletedFiles) { for (auto & file : repoInfo.workdirInfo.deletedFiles) {
writeString("deleted:", hashSink); writeString("deleted:", hashSink);