aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-06 14:45:44 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-06 14:45:44 -0700
commit8429f2b42d04a0598079c847c39d45d777613939 (patch)
tree5c4c3954173955e4cbaf1551b6757512caf324fa /sha1_name.c
parent89d3eafe9019b407d6b2cf8913c6845bde50b178 (diff)
parentb6aec868afb17acdbd486c09602a658e14c98602 (diff)
downloadgit-8429f2b42d04a0598079c847c39d45d777613939.tar.gz
git-8429f2b42d04a0598079c847c39d45d777613939.tar.xz
Merge branch 'bc/object-id'
Move from unsigned char[20] to struct object_id continues. * bc/object-id: match-trees: convert several leaf functions to use struct object_id tree-walk: convert tree_entry_extract() to use struct object_id struct name_entry: use struct object_id instead of unsigned char sha1[20] match-trees: convert shift_tree() and shift_tree_by() to use object_id test-match-trees: convert to use struct object_id sha1-name: introduce a get_oid() function
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 776101e8d..ca7ddd6f2 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