diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-07-30 12:38:24 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-07-30 12:38:24 -0500 |
commit | 05ac4db39abd02da823ad9bada96b9d264a149b7 (patch) | |
tree | 58f32fac7a67f3055da9d8ab319b448858788880 /src/nix/add-to-store.cc | |
parent | acb74d4d94b38295d606ed45dc074b3e9083e188 (diff) | |
parent | a785b3eddf8c02750b1715939069d20980bd5125 (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.cc | 11 |
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)); |