libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

add `depth` option to `clone_repository()` #1245

Closed nikitalita closed 7 months ago

nikitalita commented 7 months ago

This adds a depth option to clone_repository() for shallow clones, which has been supported since libgit2 1.7.0: https://github.com/libgit2/libgit2/commit/190a4c55df72b32adf4d60f77cbc47276b74f84b

Note: The test for the shallow clone is currently online only due to libgit2 only supporting shallow clones of remote repositories. The git cli allows you to shallow clone a local repository if you use a file URI, but it seems that libgit2 doesn't support that.

fixes #1243