Skip to content

Commit

Permalink
github fetcher: Use git+https for cloning
Browse files Browse the repository at this point in the history
git+ssh only works if you have SSH access.
  • Loading branch information
edolstra committed Sep 14, 2021
1 parent e664270 commit d72d31d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libfetchers/github.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ 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())
.clone(destDir);
Expand Down Expand Up @@ -341,7 +341,7 @@ 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",

This comment has been minimized.

Copy link
@Mindavi

Mindavi Sep 14, 2021

Contributor

Does this need the git@ in front?

This comment has been minimized.

Copy link
@edolstra

edolstra Sep 14, 2021

Author Member

No it doesn't, thanks for catching.

host, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
.applyOverrides(input.getRef().value_or("HEAD"), input.getRev())
.clone(destDir);
Expand Down

0 comments on commit d72d31d

Please sign in to comment.