mirror of
https://github.com/git/git.git
synced 2024-09-24 23:21:35 +02:00
sha1-name.c: add repo_get_oid()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
efe461b081
commit
ec580eaaa3
3
cache.h
3
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_commit(const char *str, struct object_id *oid);
|
||||||
extern int get_oid_committish(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);
|
extern int get_oid_tree(const char *str, struct object_id *oid);
|
||||||
|
@ -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",
|
* This is like "get_oid_basic()", except it allows "object ID expressions",
|
||||||
* notably "xyz^" for "parent of xyz"
|
* 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;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user