Can not walk over a repository with detached HEAD
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
Subject says it all. Here is the steps to reproduce it:
% git clone --depth 1 <URL>
% git fetch --depth 1 origin <revision hash>
% git checkout FETCH_HEAD
>>> from pygit2 import Repository
>>> repo = Repositoy(<Path to a repo>)
>>> for commit in repo.walk(revision):
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'object not found - no match for id (0c946642a3608917c3c543355de6426d5b69583b)'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the detached-HEAD setup with the listed clone, fetch, and checkout commands, then run the pygit2 Repository.walk example. Start at the repo.walk entry point and trace the object lookup behind the KeyError. Done means walking the revision completes without the reported object-not-found error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100