raises exception on refs/stash

Bug #695577 reported by Jelmer Vernooij
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dulwich
Fix Released
Medium
Jelmer Vernooij

Bug Description

_check_refname() raises an exception when it encounters a ref with the name refs/stash, which should be considered valid.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Should we call check_ref_name() simply on name rather than on name[5:]

Changed in dulwich:
status: New → Triaged
Revision history for this message
Dave Borowitz (dborowitz) wrote :

check_ref_format() is defined to be the same as git check-ref-format. The specifications in git-check-ref-format(1) apply to the part after "refs/".

Problem is, stash is an invalid ref name. From git-check-ref-format(1):
git imposes the following rules on how references are named:
...
2. They must contain at least one /. This enforces the presence of a category like heads/, tags/ etc. but the actual names are not restricted.

I think this is the cause of some issues in C git, like the stash not being able to be pushed/pulled.

IMO this means we should hard-code support for stash in RefsContainer._check_refname; we already do that for HEAD, so there's some precedent. If we want stash to be handled more consistently, we should probably take that up with the C git folks.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

works for me

Jelmer Vernooij (jelmer)
Changed in dulwich:
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Triaged → Fix Committed
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 0.8.1
Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.