Skip to content

Commit 95da93c

Browse files
committed
Input::clone(): Use std::filesystem::path
1 parent f8141a2 commit 95da93c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/libfetchers/fetchers.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ Input Input::applyOverrides(std::optional<std::string> ref, std::optional<Hash>
377377
return scheme->applyOverrides(*this, ref, rev);
378378
}
379379

380-
void Input::clone(const Settings & settings, const Path & destDir) const
380+
void Input::clone(const Settings & settings, const std::filesystem::path & destDir) const
381381
{
382382
assert(scheme);
383383
scheme->clone(settings, *this, destDir);
@@ -493,7 +493,7 @@ void InputScheme::putFile(
493493
throw Error("input '%s' does not support modifying file '%s'", input.to_string(), path);
494494
}
495495

496-
void InputScheme::clone(const Settings & settings, const Input & input, const Path & destDir) const
496+
void InputScheme::clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const
497497
{
498498
throw Error("do not know how to clone input '%s'", input.to_string());
499499
}

src/libfetchers/git.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ struct GitInputScheme : InputScheme
278278
return res;
279279
}
280280

281-
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
281+
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
282282
{
283283
auto repoInfo = getRepoInfo(input);
284284

src/libfetchers/github.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ struct GitHubInputScheme : GitArchiveInputScheme
426426
return DownloadUrl{parseURL(url), headers};
427427
}
428428

429-
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
429+
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
430430
{
431431
auto host = getHost(input);
432432
Input::fromURL(settings, fmt("git+https://%s/%s/%s.git", host, getOwner(input), getRepo(input)))
@@ -507,7 +507,7 @@ struct GitLabInputScheme : GitArchiveInputScheme
507507
return DownloadUrl{parseURL(url), headers};
508508
}
509509

510-
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
510+
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
511511
{
512512
auto host = maybeGetStrAttr(input.attrs, "host").value_or("gitlab.com");
513513
// FIXME: get username somewhere
@@ -596,7 +596,7 @@ struct SourceHutInputScheme : GitArchiveInputScheme
596596
return DownloadUrl{parseURL(url), headers};
597597
}
598598

599-
void clone(const Settings & settings, const Input & input, const Path & destDir) const override
599+
void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const override
600600
{
601601
auto host = maybeGetStrAttr(input.attrs, "host").value_or("git.sr.ht");
602602
Input::fromURL(

src/libfetchers/include/nix/fetchers/fetchers.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public:
143143

144144
Input applyOverrides(std::optional<std::string> ref, std::optional<Hash> rev) const;
145145

146-
void clone(const Settings & settings, const Path & destDir) const;
146+
void clone(const Settings & settings, const std::filesystem::path & destDir) const;
147147

148148
std::optional<std::filesystem::path> getSourcePath() const;
149149

@@ -216,7 +216,7 @@ struct InputScheme
216216

217217
virtual Input applyOverrides(const Input & input, std::optional<std::string> ref, std::optional<Hash> rev) const;
218218

219-
virtual void clone(const Settings & settings, const Input & input, const Path & destDir) const;
219+
virtual void clone(const Settings & settings, const Input & input, const std::filesystem::path & destDir) const;
220220

221221
virtual std::optional<std::filesystem::path> getSourcePath(const Input & input) const;
222222

src/nix/flake.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ struct CmdFlakeNew : CmdFlakeInitCommon
10191019

10201020
struct CmdFlakeClone : FlakeCommand
10211021
{
1022-
Path destDir;
1022+
std::filesystem::path destDir;
10231023

10241024
std::string description() override
10251025
{

0 commit comments

Comments
 (0)