-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
object not found and KeyError when scanning commits #949
Comments
I have encountered the same issue (but running in GitLab) |
This might be the same issue as dotnet/Nerdbank.GitVersioning#174: walking all commits require a full clone of the repository, not a shallow one. In Travis CI, the shallow clone is disabled with the following YAML configuration: git:
depth: false |
However, in my case the code is literally this:
Is there any other way I could get the message of the latest commit on the current branch? |
I am not familiar with the Python bindings of libgit2, but you should be able to peel the head reference to a commit, without having to walk the history. Something like this: return git.head.peel(pygit2.Commit).message |
To get the commit's time or message you need to load the object, if the object is not in the database it will fail. This may happen for example with shallow clones and with submodules (see issue #967). This works as well: repo.head.peel().commit_time
repo.head.peel().message In any case be sure to use the latest version of pygit2 1.1.1, or at least 1.0.3 |
Hi there, I'm using a python 3.7.2 and pygit2 in TravisCI for building and deploying my github pages. The python script is used to scan all the commit and find the latest commit time for every file. But now I got an error in TravisCI when building, just like this:
And this error was throw from:
This error is only appear in TravisCI, it can done its work properly in my Notebook.
Is this error caused by bugs? Or just my improper usage?
PS: The complete python scripts is here
The text was updated successfully, but these errors were encountered: