1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-18 08:19:35 +01:00

Input::clone(): Use std::filesystem::path

This commit is contained in:
Eelco Dolstra 2025-10-10 13:38:53 +02:00
parent f8141a2c26
commit 95da93c05b
5 changed files with 9 additions and 9 deletions

View file

@ -377,7 +377,7 @@ Input Input::applyOverrides(std::optional<std::string> ref, std::optional<Hash>
return scheme->applyOverrides(*this, ref, rev);
}
void Input::clone(const Settings & settings, const Path & destDir) const
void Input::clone(const Settings & settings, const std::filesystem::path & destDir) const
{
assert(scheme);
scheme->clone(settings, *this, destDir);
@ -493,7 +493,7 @@ void InputScheme::putFile(
throw Error("input '%s' does not support modifying file '%s'", input.to_string(), path);
}
void InputScheme::clone(const Settings & settings, const Input & input, const Path & destDir) const
void InputScheme::clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const
{
throw Error("do not know how to clone input '%s'", input.to_string());
}

View file

@ -278,7 +278,7 @@ struct GitInputScheme : InputScheme
return res;
}
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
{
auto repoInfo = getRepoInfo(input);

View file

@ -426,7 +426,7 @@ struct GitHubInputScheme : GitArchiveInputScheme
return DownloadUrl{parseURL(url), headers};
}
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
{
auto host = getHost(input);
Input::fromURL(settings, fmt("git+https://%s/%s/%s.git", host, getOwner(input), getRepo(input)))
@ -507,7 +507,7 @@ struct GitLabInputScheme : GitArchiveInputScheme
return DownloadUrl{parseURL(url), headers};
}
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
{
auto host = maybeGetStrAttr(input.attrs, "host").value_or("gitlab.com");
// FIXME: get username somewhere
@ -596,7 +596,7 @@ struct SourceHutInputScheme : GitArchiveInputScheme
return DownloadUrl{parseURL(url), headers};
}
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
{
auto host = maybeGetStrAttr(input.attrs, "host").value_or("git.sr.ht");
Input::fromURL(

View file

@ -143,7 +143,7 @@ public:
Input applyOverrides(std::optional<std::string> ref, std::optional<Hash> rev) const;
void clone(const Settings & settings, const Path & destDir) const;
void clone(const Settings & settings, const std::filesystem::path & destDir) const;
std::optional<std::filesystem::path> getSourcePath() const;
@ -216,7 +216,7 @@ struct InputScheme
virtual Input applyOverrides(const Input & input, std::optional<std::string> ref, std::optional<Hash> rev) const;
virtual void clone(const Settings & settings, const Input & input, const Path & destDir) const;
virtual void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const;
virtual std::optional<std::filesystem::path> getSourcePath(const Input & input) const;

View file

@ -1019,7 +1019,7 @@ struct CmdFlakeNew : CmdFlakeInitCommon
struct CmdFlakeClone : FlakeCommand
{
Path destDir;
std::filesystem::path destDir;
std::string description() override
{