diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-09-14 14:14:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 14:14:59 +0200 |
commit | 7e4dd0e2799d6ae072d9b9a7f1e21acf858dfbb3 (patch) | |
tree | 828ee73354a79fc9a2ad39f019c1fad46d25c776 /src | |
parent | 01a4fa3b6e9e3a9a29d505241492e7d4ac3372f9 (diff) | |
parent | 07996c481081d729d3ff1a53932e66c713ef5af2 (diff) |
Merge pull request #5248 from edolstra/flake-clone
Fix 'nix flake clone' on github repos
Diffstat (limited to 'src')
-rw-r--r-- | src/libfetchers/github.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index 298c05f9a..da759addf 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -273,9 +273,9 @@ struct GitHubInputScheme : GitArchiveInputScheme void clone(const Input & input, const Path & destDir) override { auto host = maybeGetStrAttr(input.attrs, "host").value_or("github.com"); - Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git", + Input::fromURL(fmt("git+https://%s/%s/%s.git", host, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo"))) - .applyOverrides(input.getRef().value_or("HEAD"), input.getRev()) + .applyOverrides(input.getRef(), input.getRev()) .clone(destDir); } }; @@ -341,9 +341,9 @@ struct GitLabInputScheme : GitArchiveInputScheme { auto host = maybeGetStrAttr(input.attrs, "host").value_or("gitlab.com"); // FIXME: get username somewhere - Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git", + Input::fromURL(fmt("git+https://git@%s/%s/%s.git", host, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo"))) - .applyOverrides(input.getRef().value_or("HEAD"), input.getRev()) + .applyOverrides(input.getRef(), input.getRev()) .clone(destDir); } }; |