1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Use libgit2 with ssh-exec support

See https://github.com/libgit2/libgit2/pull/6617. This ensures that we
get support for ~/.ssh/config, known_hosts etc.
This commit is contained in:
Eelco Dolstra 2023-11-14 13:30:51 +01:00
parent cf59ea83ec
commit 21bb180547
3 changed files with 24 additions and 19 deletions

View file

@ -336,9 +336,6 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
const std::string & url,
const std::string & refspec) override
{
/* FIXME: use libgit2. Unfortunately, it doesn't support
ssh_config at the moment. */
#if 0
Remote remote;
if (git_remote_create_anonymous(Setter(remote), *this, url.c_str()))
@ -352,20 +349,6 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
if (git_remote_fetch(remote.get(), &refspecs2, nullptr, nullptr))
throw Error("fetching '%s' from '%s': %s", refspec, url, git_error_last()->message);
#endif
// FIXME: git stderr messes up our progress indicator, so
// we're using --quiet for now. Should process its stderr.
runProgram("git", true,
{ "-C", path.abs(),
"--bare",
"fetch",
"--quiet",
"--force",
"--",
url,
refspec
}, {}, true);
}
void verifyCommit(