Skip to content

Commit 183df64

Browse files
ttaylorrgitster
authored andcommitted
commit: make 'commit_graft_pos' non-static
In the next patch, some functions will be moved from 'commit.c' to have prototypes in a new 'shallow.h' and their implementations in 'shallow.c'. Three functions in 'commit.c' use 'commit_graft_pos()' (they are 'register_commit_graft()', 'lookup_commit_graft()', and 'unregister_shallow()'). The first two of these will stay in 'commit.c', but the latter will move to 'shallow.c', and thus needs 'commit_graft_pos' to be non-static. Prepare for that by making 'commit_graft_pos' non-static so that it can be called from both 'commit.c' and 'shallow.c'. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37b9dca commit 183df64

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static const unsigned char *commit_graft_sha1_access(size_t index, void *table)
110110
return commit_graft_table[index]->oid.hash;
111111
}
112112

113-
static int commit_graft_pos(struct repository *r, const unsigned char *sha1)
113+
int commit_graft_pos(struct repository *r, const unsigned char *sha1)
114114
{
115115
return sha1_pos(sha1, r->parsed_objects->grafts,
116116
r->parsed_objects->grafts_nr,

commit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ struct commit_graft {
236236
typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *);
237237

238238
struct commit_graft *read_graft_line(struct strbuf *line);
239+
/* commit_graft_pos returns an index into r->parsed_objects->grafts. */
240+
int commit_graft_pos(struct repository *r, const unsigned char *sha1);
239241
int register_commit_graft(struct repository *r, struct commit_graft *, int);
240242
void prepare_commit_graft(struct repository *r);
241243
struct commit_graft *lookup_commit_graft(struct repository *r, const struct object_id *oid);

0 commit comments

Comments
 (0)