aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-02 19:04:27 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-02 19:04:27 +0200
commit78ad5b3d91507427fa563f3474dc52da608ad224 (patch)
tree6c3858627f1497fc8a2a4f086dd7a82d40bb5819 /src
parente1fc9f66900c1ea2b835bafbdc82beb7a10e88ff (diff)
PathInput: Add some methods
Diffstat (limited to 'src')
-rw-r--r--src/libfetchers/path.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc
index 9801d9b86..037404726 100644
--- a/src/libfetchers/path.cc
+++ b/src/libfetchers/path.cc
@@ -19,6 +19,22 @@ struct PathInput : Input
std::optional<Hash> getRev() const override { return rev; }
+ bool operator ==(const Input & other) const override
+ {
+ auto other2 = dynamic_cast<const PathInput *>(&other);
+ return
+ other2
+ && path == other2->path
+ && rev == other2->rev
+ && revCount == other2->revCount
+ && lastModified == other2->lastModified;
+ }
+
+ bool isImmutable() const override
+ {
+ return (bool) narHash;
+ }
+
ParsedURL toURL() const override
{
auto query = attrsToQuery(toAttrsInternal());