Commit Graph

7 Commits

Author SHA1 Message Date
Russell Belfer
aa8f010120 Add git_oid_strcmp and use it for git_oid_streq
Add a new git_oid_strcmp that compares a string OID with a hex
oid for sort order, and then reimplement git_oid_streq using it.
This actually should speed up git_oid_streq because it only reads
as far into the string as it needs to, whereas previously it would
convert the whole string into an OID and then use git_oid_cmp.
2013-04-29 08:59:46 -07:00
Russell Belfer
8564a0224a Fix fragile git_oid_ncmp
git_oid_ncmp was making some assumptions about the length of
the data - this shifts the check to the top of the loop so it
will work more robustly, limits the max, and adds some tests
to verify the functionality.
2013-04-29 08:51:24 -07:00
Vicent Marti
13640d1bb8 oid: Do not parse OIDs longer than 40 2013-03-25 21:39:11 +01:00
Xavier L.
b3c174835b Clarified string value 2013-03-21 14:50:28 -03:00
Xavier L
7e527ca700 Added test case for new function 2013-03-21 12:16:31 -04:00
Russell Belfer
7c7ff7d11e Migrate index, oid, and utils to new errors
This includes a few cleanups that came up while converting
these files.

This commit introduces a could new git error classes, including
the catchall class: GITERR_INVALID which I'm using as the class
for invalid and out of range values which are detected at too low
a level of library to use a higher level classification.  For
example, an overflow error in parsing an integer or a bad letter
in parsing an OID string would generate an error in this class.
2012-03-19 16:10:11 -07:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00