aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-04-17 23:10:36 +0000
committerJunio C Hamano <gitster@pobox.com>2016-04-19 15:28:58 -0700
commit2764fd93ad091a1acbe07b4a165ae3489cf46c15 (patch)
tree738f3f44761838b5843ea709d54763af1de3c01b /sha1_name.c
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71 (diff)
downloadgit-2764fd93ad091a1acbe07b4a165ae3489cf46c15.tar.gz
git-2764fd93ad091a1acbe07b4a165ae3489cf46c15.tar.xz
sha1-name: introduce a get_oid() function
The get_oid() function is equivalent to the get_sha1() function, but uses a struct object_id instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 3acf221f9..1ae20fec1 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -1215,6 +1215,15 @@ int get_sha1(const char *name, unsigned char *sha1)
}
/*
+ * This is like "get_sha1()", but for struct object_id.
+ */
+int get_oid(const char *name, struct object_id *oid)
+{
+ return get_sha1(name, oid->hash);
+}
+
+
+/*
* Many callers know that the user meant to name a commit-ish by
* syntactical positions where the object name appears. Calling this
* function allows the machinery to disambiguate shorter-than-unique