gitfs w/pygit2 - corner case, traceback with short hexidecimal environment names #34213
Labels
Bug
broken, incorrect, or confusing behavior
Core
relates to code central or existential to Salt
File Servers
fixed-pls-verify
fix is linked, bug author to confirm fix
P3
Priority 3
ZD
The issue is related to a Zendesk customer support ticket.
ZRELEASED - 2015.8.11
ZRELEASED - 2016.3.2
Milestone
Description of Issue/Question
Setup
Configure two gitfs remotes. One of them must have a branch with a 3-character-or-less hexidecimal name (e.g.
abc
), while the other must not.Steps to Reproduce Issue
Try to list files in the short-named hexidecimal environment mentioned above.
This results in a traceback due to some code in gitfs which allows one to use a commit SHA as a gitfs environment:
What's happening here is that
abc
happens to be A) hexidecimal, causing the rev-parse code in libgit2 to treat it as a commit SHA, and B) shorter than the minimum SHA length (defined as4
by libgit2, as seen here), leading to an error being raised by pygit2. TheValueError
simply needs to be caught in the try/except block surrounding the call toself.repo.revparse_single()
.Versions Report
Affects 2015.8.0 and newer.
The text was updated successfully, but these errors were encountered: