mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 23:26:39 +00:00
odb: Straighten oid prefix handling
This commit is contained in:
parent
51a5e13347
commit
d19dd9cf73
@ -641,10 +641,12 @@ static int loose_backend__read_prefix(
|
|||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
|
assert(len <= GIT_OID_HEXSZ);
|
||||||
|
|
||||||
if (len < GIT_OID_MINPREFIXLEN)
|
if (len < GIT_OID_MINPREFIXLEN)
|
||||||
error = git_odb__error_ambiguous("prefix length too short");
|
error = git_odb__error_ambiguous("prefix length too short");
|
||||||
|
|
||||||
else if (len >= GIT_OID_HEXSZ) {
|
else if (len == GIT_OID_HEXSZ) {
|
||||||
/* We can fall back to regular read method */
|
/* We can fall back to regular read method */
|
||||||
error = loose_backend__read(buffer_p, len_p, type_p, backend, short_oid);
|
error = loose_backend__read(buffer_p, len_p, type_p, backend, short_oid);
|
||||||
if (!error)
|
if (!error)
|
||||||
|
Loading…
Reference in New Issue
Block a user