libgit2 / pygit2

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

Problem with network shares #1185

Closed chris9x closed 1 year ago

chris9x commented 1 year ago

The following two lines work fine when _my_repopath is local path or a mounted network share (on Windows) for pygit2 version 1.6.1. For a newer version (1.11.1) an exception is thrown for the mounted network share.

repo_path = discover_repository(my_repo_path)
repo = Repository(repo_path)
chris9x commented 1 year ago

In the meantime, I have found the cause and the solution for the problem. It is related to libgit2 issue #6279. With newer version the ownership will be checked. In my case, I got the error message “…is not owned by current user”. I solved the problem with the setting:

pygit2.option(pygit2.GIT_OPT_SET_OWNER_VALIDATION, False)