Skip to content

Commit ec580ea

Browse files
pcloudsgitster
authored andcommitted
sha1-name.c: add repo_get_oid()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent efe461b commit ec580ea

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,8 @@ enum get_oid_result {
13801380
*/
13811381
};
13821382

1383-
extern int get_oid(const char *str, struct object_id *oid);
1383+
int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
1384+
#define get_oid(str, oid) repo_get_oid(the_repository, str, oid)
13841385
extern int get_oid_commit(const char *str, struct object_id *oid);
13851386
extern int get_oid_committish(const char *str, struct object_id *oid);
13861387
extern int get_oid_tree(const char *str, struct object_id *oid);

sha1-name.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,10 +1573,10 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
15731573
* This is like "get_oid_basic()", except it allows "object ID expressions",
15741574
* notably "xyz^" for "parent of xyz"
15751575
*/
1576-
int get_oid(const char *name, struct object_id *oid)
1576+
int repo_get_oid(struct repository *r, const char *name, struct object_id *oid)
15771577
{
15781578
struct object_context unused;
1579-
return get_oid_with_context(the_repository, name, 0, oid, &unused);
1579+
return get_oid_with_context(r, name, 0, oid, &unused);
15801580
}
15811581

15821582

0 commit comments

Comments
 (0)