hex: add oid_to_hex_r()
This function works just like sha1_to_hex_r, except that it takes a pointer to struct object_id instead of a pointer to unsigned char. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
05219a1276
commit
55c529a700
1
cache.h
1
cache.h
@ -1193,6 +1193,7 @@ extern int get_oid_hex(const char *hex, struct object_id *sha1);
|
|||||||
* printf("%s -> %s", sha1_to_hex(one), sha1_to_hex(two));
|
* printf("%s -> %s", sha1_to_hex(one), sha1_to_hex(two));
|
||||||
*/
|
*/
|
||||||
extern char *sha1_to_hex_r(char *out, const unsigned char *sha1);
|
extern char *sha1_to_hex_r(char *out, const unsigned char *sha1);
|
||||||
|
extern char *oid_to_hex_r(char *out, const struct object_id *oid);
|
||||||
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
|
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
|
||||||
extern char *oid_to_hex(const struct object_id *oid); /* same static buffer as sha1_to_hex */
|
extern char *oid_to_hex(const struct object_id *oid); /* same static buffer as sha1_to_hex */
|
||||||
|
|
||||||
|
5
hex.c
5
hex.c
@ -77,6 +77,11 @@ char *sha1_to_hex_r(char *buffer, const unsigned char *sha1)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *oid_to_hex_r(char *buffer, const struct object_id *oid)
|
||||||
|
{
|
||||||
|
return sha1_to_hex_r(buffer, oid->hash);
|
||||||
|
}
|
||||||
|
|
||||||
char *sha1_to_hex(const unsigned char *sha1)
|
char *sha1_to_hex(const unsigned char *sha1)
|
||||||
{
|
{
|
||||||
static int bufno;
|
static int bufno;
|
||||||
|
Loading…
Reference in New Issue
Block a user