parent
872a22fa23
commit
9a5ca802c7
|
@ -27,6 +27,8 @@ struct Input : std::enable_shared_from_this<Input>
|
||||||
std::string type;
|
std::string type;
|
||||||
std::optional<Hash> narHash;
|
std::optional<Hash> narHash;
|
||||||
|
|
||||||
|
virtual ~Input() { }
|
||||||
|
|
||||||
virtual bool operator ==(const Input & other) const { return false; }
|
virtual bool operator ==(const Input & other) const { return false; }
|
||||||
|
|
||||||
virtual bool isDirect() const { return true; }
|
virtual bool isDirect() const { return true; }
|
||||||
|
@ -63,6 +65,8 @@ struct ParsedURL;
|
||||||
|
|
||||||
struct InputScheme
|
struct InputScheme
|
||||||
{
|
{
|
||||||
|
virtual ~InputScheme() { }
|
||||||
|
|
||||||
virtual std::unique_ptr<Input> inputFromURL(const ParsedURL & url) = 0;
|
virtual std::unique_ptr<Input> inputFromURL(const ParsedURL & url) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ struct GitInput : Input
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<Path> getSourcePath() const
|
std::optional<Path> getSourcePath() const override
|
||||||
{
|
{
|
||||||
if (url.scheme == "git+file" && !ref && !rev)
|
if (url.scheme == "git+file" && !ref && !rev)
|
||||||
return url.path;
|
return url.path;
|
||||||
|
@ -172,7 +172,8 @@ struct GitInput : Input
|
||||||
return {std::move(*tree), input};
|
return {std::move(*tree), input};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [isLocal, actualUrl] = getActualUrl();
|
auto [isLocal, actualUrl_] = getActualUrl();
|
||||||
|
auto actualUrl = actualUrl_; // work around clang bug
|
||||||
|
|
||||||
// If this is a local directory and no ref or revision is
|
// If this is a local directory and no ref or revision is
|
||||||
// given, then allow the use of an unclean working tree.
|
// given, then allow the use of an unclean working tree.
|
||||||
|
|
|
@ -84,7 +84,8 @@ struct MercurialInput : Input
|
||||||
|
|
||||||
auto input = std::make_shared<MercurialInput>(*this);
|
auto input = std::make_shared<MercurialInput>(*this);
|
||||||
|
|
||||||
auto [isLocal, actualUrl] = getActualUrl();
|
auto [isLocal, actualUrl_] = getActualUrl();
|
||||||
|
auto actualUrl = actualUrl_; // work around clang bug
|
||||||
|
|
||||||
// FIXME: return lastModified.
|
// FIXME: return lastModified.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue