summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cache.h1
-rw-r--r--hex.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 6049f86..7bd7c47 100644
--- a/cache.h
+++ b/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));
*/
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 *oid_to_hex(const struct object_id *oid); /* same static buffer as sha1_to_hex */
diff --git a/hex.c b/hex.c
index 0519f85..9619b67 100644
--- a/hex.c
+++ b/hex.c
@@ -77,6 +77,11 @@ char *sha1_to_hex_r(char *buffer, const unsigned char *sha1)
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)
{
static int bufno;