-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Setting the depth
parameter doesn't seem to work when using the libssh2 backend.
Reproduction steps
Modify the clone example to set the depth parameter:
diff --git a/examples/clone.c b/examples/clone.c
index 22d9d9b61..d8873cef1 100644
--- a/examples/clone.c
+++ b/examples/clone.c
@@ -90,6 +90,7 @@ int lg2_clone(git_repository *repo, int argc, char **argv)
clone_opts.fetch_opts.callbacks.transfer_progress = &fetch_progress;
clone_opts.fetch_opts.callbacks.credentials = cred_acquire_cb;
clone_opts.fetch_opts.callbacks.payload = &pd;
+ clone_opts.fetch_opts.depth = 1;
/* Do the clone */
error = git_clone(&cloned_repo, url, path, &clone_opts);
Build with libssh2:
cmake -DUSE_SSH=libssh2 -DBUILD_EXAMPLES=on ..
Run the example trying to clone an ssh URL:
./examples/lg2 clone ssh://git@github.com/libgit2/libgit2.git asdf
SSH Key: /Users/eric/.ssh/id_ed25519
Password: ...
ERROR 12: could not read from remote repository
Bad news:
could not read from remote repository
Note that it works with the exec
backend.
Expected behavior
Should be able to set depth with SSH.
Actual behavior
Get GIT_EEOF GIT_ERROR_NET error.
Version of libgit2 (release number or SHA1)
Operating system(s) tested
macOS
Metadata
Metadata
Assignees
Labels
No labels