You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to the code base and have been trying to get my head around it (though pretty easy to follow along).
With the repo I am working with I am seeing this:
>>> from dulwich.repo import Repo
>>> repo = Repo("<my bare repo path>")
>>> repo.head()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/brian/Development/dulwich/dulwich/repo.py", line 308, in head
return self.refs.follow('HEAD')
File "/Users/brian/Development/dulwich/dulwich/repo.py", line 82, in follow
return follow_ref(self, name)
File "/Users/brian/Development/dulwich/dulwich/repo.py", line 65, in follow_ref
return follow_ref(container, ref)
File "/Users/brian/Development/dulwich/dulwich/repo.py", line 60, in follow_ref
contents = container[name]
File "/Users/brian/Development/dulwich/dulwich/repo.py", line 163, in __getitem__
raise KeyError(name)
KeyError: 'refs/heads/master'
Digging in a bit deeper I see that refs/heads/master is a packed ref which is why it cannot find it in refs/heads. Is there any reason why Repo.head uses self.refs.follow over self.ref? Hence the title. ref looks in packed refs, but doesn't know what HEAD is equal to to pull out the right ref.
I am sort of lost in the implementation to find the correct place to solve this.
The text was updated successfully, but these errors were encountered:
# This is the 1st commit message:
Support linked working directories
Support for linked working directories:
- Add `commondir()` (equivalent to `GIT_COMMON_DIR`)
- Read the `commondir` file, to set it.
See `git-worktree(1)` and `gitrepository-layout(5)`.
# The commit message #2 will be skipped:
# Fix DiskRefsContainer.refpath()
# The commit message #3 will be skipped:
# Add a testsuite
# The commit message #4 will be skipped:
# Add @skipIf for WorkingTreeTestCase
# The commit message #5 will be skipped:
# worktree is optional and default to path
# The commit message #6 will be skipped:
# add a TODO
# The commit message #7 will be skipped:
# Save one syscall
#
# See https://github.com/jelmer/dulwich/pull/454/files/0927deb7cd2ad24294b89e319ea060ed488acbba#r82424872
# The commit message #8 will be skipped:
# Read commondir with get_named_file()
I am new to the code base and have been trying to get my head around it (though pretty easy to follow along).
With the repo I am working with I am seeing this:
Digging in a bit deeper I see that
refs/heads/master
is a packed ref which is why it cannot find it inrefs/heads
. Is there any reason whyRepo.head
usesself.refs.follow
overself.ref
? Hence the title.ref
looks in packed refs, but doesn't know whatHEAD
is equal to to pull out the right ref.I am sort of lost in the implementation to find the correct place to solve this.
The text was updated successfully, but these errors were encountered: