aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-06-07 15:06:12 +0200
committerEelco Dolstra <edolstra@gmail.com>2023-06-13 14:13:50 +0200
commit3402b650cdce318e42acd4dc34f42423cafef587 (patch)
tree4967813788621c540cfd2951f53a6e4df6ec5b76 /src
parent041486b11674e0480ad85f63d262c33a09276ef1 (diff)
Add a generic check for rev attribute mismatches
Diffstat (limited to 'src')
-rw-r--r--src/libfetchers/fetchers.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index 91db3a9eb..2860c1ceb 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -159,6 +159,12 @@ std::pair<Tree, Input> Input::fetch(ref<Store> store) const
input.to_string(), *prevLastModified);
}
+ if (auto prevRev = getRev()) {
+ if (input.getRev() != prevRev)
+ throw Error("'rev' attribute mismatch in input '%s', expected %s",
+ input.to_string(), prevRev->gitRev());
+ }
+
if (auto prevRevCount = getRevCount()) {
if (input.getRevCount() != prevRevCount)
throw Error("'revCount' attribute mismatch in input '%s', expected %d",