aboutsummaryrefslogtreecommitdiff
path: root/src/nix/add-to-store.cc
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-07-30 12:38:24 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-07-30 12:38:24 -0500
commit05ac4db39abd02da823ad9bada96b9d264a149b7 (patch)
tree58f32fac7a67f3055da9d8ab319b448858788880 /src/nix/add-to-store.cc
parentacb74d4d94b38295d606ed45dc074b3e9083e188 (diff)
parenta785b3eddf8c02750b1715939069d20980bd5125 (diff)
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
Diffstat (limited to 'src/nix/add-to-store.cc')
-rw-r--r--src/nix/add-to-store.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index 48a4722ae..e183cb8b5 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -53,18 +53,11 @@ struct CmdAddToStore : MixDryRun, StoreCommand
auto narHash = hashString(htSHA256, *sink.s);
- Hash hash;
- switch (ingestionMethod) {
- case FileIngestionMethod::Recursive: {
- hash = narHash;
- break;
- }
- case FileIngestionMethod::Flat: {
+ Hash hash = narHash;
+ if (ingestionMethod == FileIngestionMethod::Flat) {
HashSink hsink(htSHA256);
readFile(path, hsink);
hash = hsink.finish().first;
- break;
- }
}
ValidPathInfo info(store->makeFixedOutputPath(ingestionMethod, hash, *namePart));