Skip to content

Commit 65e5046

Browse files
pcloudsgitster
authored andcommitted
sha1-name.c: remove the_repo from other get_oid_*
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e270f42 commit 65e5046

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

cache.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,19 +1381,25 @@ enum get_oid_result {
13811381
};
13821382

13831383
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)
1385-
extern int get_oid_commit(const char *str, struct object_id *oid);
1386-
extern int get_oid_committish(const char *str, struct object_id *oid);
1387-
extern int get_oid_tree(const char *str, struct object_id *oid);
1388-
extern int get_oid_treeish(const char *str, struct object_id *oid);
1389-
extern int get_oid_blob(const char *str, struct object_id *oid);
1384+
int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
1385+
int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
1386+
int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
1387+
int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
1388+
int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
13901389
void maybe_die_on_misspelt_object_name(struct repository *repo,
13911390
const char *name,
13921391
const char *prefix);
13931392
extern enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
13941393
unsigned flags, struct object_id *oid,
13951394
struct object_context *oc);
13961395

1396+
#define get_oid(str, oid) repo_get_oid(the_repository, str, oid)
1397+
#define get_oid_commit(str, oid) repo_get_oid_commit(the_repository, str, oid)
1398+
#define get_oid_committish(str, oid) repo_get_oid_committish(the_repository, str, oid)
1399+
#define get_oid_tree(str, oid) repo_get_oid_tree(the_repository, str, oid)
1400+
#define get_oid_treeish(str, oid) repo_get_oid_treeish(the_repository, str, oid)
1401+
#define get_oid_blob(str, oid) repo_get_oid_blob(the_repository, str, oid)
1402+
13971403
typedef int each_abbrev_fn(const struct object_id *oid, void *);
13981404
int repo_for_each_abbrev(struct repository *r, const char *prefix, each_abbrev_fn, void *);
13991405
#define for_each_abbrev(prefix, fn, data) repo_for_each_abbrev(the_repository, prefix, fn, data)

sha1-name.c

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,43 +1590,48 @@ int repo_get_oid(struct repository *r, const char *name, struct object_id *oid)
15901590
* commit-ish. It is merely to give a hint to the disambiguation
15911591
* machinery.
15921592
*/
1593-
int get_oid_committish(const char *name, struct object_id *oid)
1593+
int repo_get_oid_committish(struct repository *r,
1594+
const char *name,
1595+
struct object_id *oid)
15941596
{
15951597
struct object_context unused;
1596-
return get_oid_with_context(the_repository,
1597-
name, GET_OID_COMMITTISH,
1598+
return get_oid_with_context(r, name, GET_OID_COMMITTISH,
15981599
oid, &unused);
15991600
}
16001601

1601-
int get_oid_treeish(const char *name, struct object_id *oid)
1602+
int repo_get_oid_treeish(struct repository *r,
1603+
const char *name,
1604+
struct object_id *oid)
16021605
{
16031606
struct object_context unused;
1604-
return get_oid_with_context(the_repository,
1605-
name, GET_OID_TREEISH,
1607+
return get_oid_with_context(r, name, GET_OID_TREEISH,
16061608
oid, &unused);
16071609
}
16081610

1609-
int get_oid_commit(const char *name, struct object_id *oid)
1611+
int repo_get_oid_commit(struct repository *r,
1612+
const char *name,
1613+
struct object_id *oid)
16101614
{
16111615
struct object_context unused;
1612-
return get_oid_with_context(the_repository,
1613-
name, GET_OID_COMMIT,
1616+
return get_oid_with_context(r, name, GET_OID_COMMIT,
16141617
oid, &unused);
16151618
}
16161619

1617-
int get_oid_tree(const char *name, struct object_id *oid)
1620+
int repo_get_oid_tree(struct repository *r,
1621+
const char *name,
1622+
struct object_id *oid)
16181623
{
16191624
struct object_context unused;
1620-
return get_oid_with_context(the_repository,
1621-
name, GET_OID_TREE,
1625+
return get_oid_with_context(r, name, GET_OID_TREE,
16221626
oid, &unused);
16231627
}
16241628

1625-
int get_oid_blob(const char *name, struct object_id *oid)
1629+
int repo_get_oid_blob(struct repository *r,
1630+
const char *name,
1631+
struct object_id *oid)
16261632
{
16271633
struct object_context unused;
1628-
return get_oid_with_context(the_repository,
1629-
name, GET_OID_BLOB,
1634+
return get_oid_with_context(r, name, GET_OID_BLOB,
16301635
oid, &unused);
16311636
}
16321637

0 commit comments

Comments
 (0)