aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-01 23:54:20 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-01 23:54:20 +0100
commit887730aab39dd63a37d49d72a07c6441ea3b2f92 (patch)
tree9bda18dac5be9832ea797a73fe375829ba9f9785 /src/nix/flake.cc
parentb9d64f931893120834fa54ebf084764d2e22ba33 (diff)
Remove superfluous TreeInfo::rev field
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r--src/nix/flake.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index d3c03e214..7924cec7c 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -84,8 +84,8 @@ static void printFlakeInfo(const Store & store, const Flake & flake)
if (flake.description)
std::cout << fmt("Description: %s\n", *flake.description);
std::cout << fmt("Path: %s\n", store.printStorePath(flake.sourceInfo->storePath));
- if (flake.sourceInfo->info.rev)
- std::cout << fmt("Revision: %s\n", flake.sourceInfo->info.rev->to_string(Base16, false));
+ if (auto rev = flake.resolvedRef.input->getRev())
+ std::cout << fmt("Revision: %s\n", rev->to_string(Base16, false));
if (flake.sourceInfo->info.revCount)
std::cout << fmt("Revisions: %s\n", *flake.sourceInfo->info.revCount);
if (flake.sourceInfo->info.lastModified)
@@ -100,8 +100,8 @@ static nlohmann::json flakeToJson(const Store & store, const Flake & flake)
j["description"] = *flake.description;
j["edition"] = flake.edition;
j["url"] = flake.resolvedRef.input->to_string();
- if (flake.sourceInfo->info.rev)
- j["revision"] = flake.sourceInfo->info.rev->to_string(Base16, false);
+ if (auto rev = flake.resolvedRef.input->getRev())
+ j["revision"] = rev->to_string(Base16, false);
if (flake.sourceInfo->info.revCount)
j["revCount"] = *flake.sourceInfo->info.revCount;
if (flake.sourceInfo->info.lastModified)