]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sha1-name.c: add repo_get_oid()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 16 Apr 2019 09:33:37 +0000 (16:33 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Apr 2019 09:56:53 +0000 (18:56 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
sha1-name.c

diff --git a/cache.h b/cache.h
index 2149dc4f56d9ad5460e622b244d72eb1b7c0fd7f..f6e87194d0a2dfd075acdc1386788f14b16990fe 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1380,7 +1380,8 @@ enum get_oid_result {
                       */
 };
 
-extern int get_oid(const char *str, struct object_id *oid);
+int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
+#define get_oid(str, oid) repo_get_oid(the_repository, str, oid)
 extern int get_oid_commit(const char *str, struct object_id *oid);
 extern int get_oid_committish(const char *str, struct object_id *oid);
 extern int get_oid_tree(const char *str, struct object_id *oid);
index 64a50d12919bc4cd27a474fa90899d963e20a830..953df0d692d62f8d2ce3bc7d97ecd9b59ce18a19 100644 (file)
@@ -1573,10 +1573,10 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
  * This is like "get_oid_basic()", except it allows "object ID expressions",
  * notably "xyz^" for "parent of xyz"
  */
-int get_oid(const char *name, struct object_id *oid)
+int repo_get_oid(struct repository *r, const char *name, struct object_id *oid)
 {
        struct object_context unused;
-       return get_oid_with_context(the_repository, name, 0, oid, &unused);
+       return get_oid_with_context(r, name, 0, oid, &unused);
 }