Skip to content

Commit

Permalink
odb: Straighten oid prefix handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltoken committed Aug 18, 2013
1 parent 51a5e13 commit d19dd9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/odb_loose.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,12 @@ static int loose_backend__read_prefix(
{
int error = 0;

assert(len <= GIT_OID_HEXSZ);

if (len < GIT_OID_MINPREFIXLEN)
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 */
error = loose_backend__read(buffer_p, len_p, type_p, backend, short_oid);
if (!error)
Expand Down

0 comments on commit d19dd9c

Please sign in to comment.