aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Kenigsberg <matthewkenigsberg@gmail.com>2023-02-28 16:04:17 -0700
committerMatthew Kenigsberg <matthewkenigsberg@gmail.com>2023-02-28 16:04:41 -0700
commitf86f2b973f3b07134736fd96c1eff1da184dc1af (patch)
treef0bcae54cef6e5ba677ade1005ba174f84fe50a6
parentd5af43cb420fd5228c6e07a62fc53fcadb626aa3 (diff)
Always set valid in path-info --json output
Currently the valid key is only present when the path is invalid, which makes checking path validity more complex than it should be. With this change, the valid key can always be used to check if a path is valid
-rw-r--r--src/libstore/store-api.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 601efa1cc..f32c2d30c 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -855,6 +855,7 @@ json Store::pathInfoToJSON(const StorePathSet & storePaths,
auto info = queryPathInfo(storePath);
jsonPath["path"] = printStorePath(info->path);
+ jsonPath["valid"] = true;
jsonPath["narHash"] = info->narHash.to_string(hashBase, true);
jsonPath["narSize"] = info->narSize;