Skip to content
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

remote.fetch depth= parameter broken with anonymous remotes #1314

Open
spwhitton opened this issue Aug 21, 2024 · 2 comments
Open

remote.fetch depth= parameter broken with anonymous remotes #1314

spwhitton opened this issue Aug 21, 2024 · 2 comments

Comments

@spwhitton
Copy link

import os
import pygit2
source = pygit2.Repository("pygit2")
dest = pygit2.init_repository("dest", bare=True)
remote = dest.remotes.create_anonymous(f'file://{os.path.abspath("pygit2")}')
remote.fetch(depth=1, refspecs=[f"refs/tags/v1.15.1:refs/tags/v1.15.1"])
# now if you 'git log v1.15.1' in ./dest you'll see many commits, not just one

ping @nikitalita

Thanks.

@nikitalita
Copy link
Contributor

Might be due to this? #1245

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.

@spwhitton
Copy link
Author

spwhitton commented Aug 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants