-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git clone with depth 1 fails with code -20 #1084
Comments
Any change you are using custom transport? There seems to be some similar issues in libgit2 libgit2/libgit2#5799 also using git2-rs, though I am not sure if that is actually the same thing. |
I don't know? Everything on the rust side is pretty standard, do you mean on the server-side for the git repo? |
I filed an upstream issue at libgit2/libgit2#6889. Can you please post a complete runnable example that demonstrates the problem that you are experiencing? I'm not quite getting the same error message that you are. For example: use git2::*;
use std::path::Path;
fn main() {
let mut callbacks = RemoteCallbacks::new();
callbacks.credentials(|_url, username_from_url, _allowed_types| {
Cred::ssh_key(
username_from_url
.ok_or_else(|| git2::Error::from_str("no username from url"))
.unwrap(),
None,
Path::new("/Users/eric/.ssh/id_ed25519"),
None,
)
});
let mut fo = git2::FetchOptions::new();
fo.depth(1);
fo.remote_callbacks(callbacks);
let mut builder = git2::build::RepoBuilder::new();
builder.fetch_options(fo);
builder
.clone(
"ssh://[email protected]/libgit2/libgit2.git",
Path::new("asdf"),
)
.unwrap();
} With that I get:
|
I get the same. |
Sorry for the late reply, I've been drowning in work-related issues. I'll try and get a minimal repro up next week. |
Hi,
I have the following implementation:
callbacks(ssh_key)
looks like this:This fails with an error that I cannot understand:
Running it with
depth(0)
works, but is very slow due to the large history of the repo I'm cloning. If I can do more to help figure this out (if it's a bug in git2-rs) or if I should look elsewhere, just let me know :)The text was updated successfully, but these errors were encountered: