aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/make-content-addressed.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-30 09:59:55 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-30 09:59:55 -0500
commit974a983351283a644228b10731e4f9d2ff01e533 (patch)
tree3bff17d9d76c55180366ccb4f9f88d28642ae1f1 /src/libstore/make-content-addressed.cc
parentadb36080342488c0414a944c20c949938132e153 (diff)
Shrink diff in two places
Stuff crept in there.
Diffstat (limited to 'src/libstore/make-content-addressed.cc')
-rw-r--r--src/libstore/make-content-addressed.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstore/make-content-addressed.cc b/src/libstore/make-content-addressed.cc
index 3ee64c77a..ff9f5cdaa 100644
--- a/src/libstore/make-content-addressed.cc
+++ b/src/libstore/make-content-addressed.cc
@@ -31,12 +31,14 @@ std::map<StorePath, StorePath> makeContentAddressed(
for (auto & ref : oldInfo->references) {
if (ref == path)
refs.self = true;
- auto i = remappings.find(ref);
- auto replacement = i != remappings.end() ? i->second : ref;
- // FIXME: warn about unremapped paths?
- if (replacement != ref) {
- rewrites.insert_or_assign(srcStore.printStorePath(ref), srcStore.printStorePath(replacement));
- refs.others.insert(std::move(replacement));
+ else {
+ auto i = remappings.find(ref);
+ auto replacement = i != remappings.end() ? i->second : ref;
+ // FIXME: warn about unremapped paths?
+ if (replacement != ref) {
+ rewrites.insert_or_assign(srcStore.printStorePath(ref), srcStore.printStorePath(replacement));
+ refs.others.insert(std::move(replacement));
+ }
}
}