aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2020-03-29 01:04:55 -0400
committerJohn Ericson <git@JohnEricson.me>2020-03-29 15:16:20 -0400
commit225e62a56a7cebb030bebffb8d2bd7afe21cc64a (patch)
tree4cd7999dab685a09aea40236d631a9c2a43e2a40 /src/nix-store/nix-store.cc
parenteb1911e277bfcc1b161cb996205ae1696f496099 (diff)
Replace some `bool recursive` with a new `FileIngestionMethod` enum
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 806ab7563..9a26eb57f 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -174,10 +174,10 @@ static void opAdd(Strings opFlags, Strings opArgs)
store. */
static void opAddFixed(Strings opFlags, Strings opArgs)
{
- bool recursive = false;
+ FileIngestionMethod recursive = FileIngestionMethod::Flat;
for (auto & i : opFlags)
- if (i == "--recursive") recursive = true;
+ if (i == "--recursive") recursive = FileIngestionMethod::Recursive;
else throw UsageError(format("unknown flag '%1%'") % i);
if (opArgs.empty())
@@ -194,10 +194,10 @@ static void opAddFixed(Strings opFlags, Strings opArgs)
/* Hack to support caching in `nix-prefetch-url'. */
static void opPrintFixedPath(Strings opFlags, Strings opArgs)
{
- bool recursive = false;
+ FileIngestionMethod recursive = FileIngestionMethod::Flat;
for (auto i : opFlags)
- if (i == "--recursive") recursive = true;
+ if (i == "--recursive") recursive = FileIngestionMethod::Recursive;
else throw UsageError(format("unknown flag '%1%'") % i);
if (opArgs.size() != 3)