Ggit.OId¶
Fields¶
None
Methods¶
| class | new_from_raw(raw) | 
| class | new_from_string(str) | 
| compare(b) | |
| copy() | |
| equal(b) | |
| free() | |
| has_prefix(prefix) | |
| hash() | |
| is_zero() | |
| to_string() | 
Details¶
- 
class Ggit.OId¶
- Represents a unique ID of any object. - 
classmethod new_from_raw(raw)¶
- Parameters: - raw ( - bytes) – the raw input bytes to be copied.- Returns: - a newly allocated - Ggit.OIdor- Noneon error.- Return type: - Ggit.OIdor- None- Creates a new - Ggit.OIdfrom a raw oid.
 - 
classmethod new_from_string(str)¶
- Parameters: - str ( - str) – input hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes).- Returns: - a newly allocated - Ggit.OIdor- Noneon error.- Return type: - Ggit.OIdor- None- Parses a hex formatted object id into a - Ggit.OId.
 - 
compare(b)¶
- Parameters: - b ( - Ggit.OId) – second- Ggit.OId.- Returns: - <0, 0, >0 if a < b, a == b, a > b. - Return type: - int- Compare two - Ggit.OIdstructures.
 - 
copy()¶
- Returns: - a newly allocated - Ggit.OId.- Return type: - Ggit.OIdor- None- Copies self into a newly allocated - Ggit.OId.
 - 
equal(b)¶
- Parameters: - b ( - Ggit.OId) – a- Ggit.OId.- Returns: - Trueif self and b are equal,- Falseotherwise- Return type: - bool- Compares two - Ggit.OIdfor equality.
 - 
free()¶
- Frees self. 
 - 
has_prefix(prefix)¶
- Parameters: - prefix ( - str) – a prefix.- Returns: - Trueif the id has the given prefix,- Falseotherwise.- Return type: - bool- Check whether the object id has a given prefix. Note that the prefix is specified in hexadecimal ASCII. 
 
- 
classmethod