summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2020-04-30 21:11:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-30 21:18:41 (GMT)
commit183df649ca6f10d07a6d155761eef2d52a4f39cd (patch)
tree1bdee04ad383fe6663f82fc4548ac37c47c472eb
parent37b9dcabfc48b0cbce638140279878dac37aec73 (diff)
downloadgit-183df649ca6f10d07a6d155761eef2d52a4f39cd.zip
git-183df649ca6f10d07a6d155761eef2d52a4f39cd.tar.gz
git-183df649ca6f10d07a6d155761eef2d52a4f39cd.tar.bz2
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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit.c2
-rw-r--r--commit.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index a6cfa41..efa9ea7 100644
--- a/commit.c
+++ b/commit.c
@@ -110,7 +110,7 @@ static const unsigned char *commit_graft_sha1_access(size_t index, void *table)
return commit_graft_table[index]->oid.hash;
}
-static int commit_graft_pos(struct repository *r, const unsigned char *sha1)
+int commit_graft_pos(struct repository *r, const unsigned char *sha1)
{
return sha1_pos(sha1, r->parsed_objects->grafts,
r->parsed_objects->grafts_nr,
diff --git a/commit.h b/commit.h
index ab91d21..0fe1e1b 100644
--- a/commit.h
+++ b/commit.h
@@ -236,6 +236,8 @@ struct commit_graft {
typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *);
struct commit_graft *read_graft_line(struct strbuf *line);
+/* commit_graft_pos returns an index into r->parsed_objects->grafts. */
+int commit_graft_pos(struct repository *r, const unsigned char *sha1);
int register_commit_graft(struct repository *r, struct commit_graft *, int);
void prepare_commit_graft(struct repository *r);
struct commit_graft *lookup_commit_graft(struct repository *r, const struct object_id *oid);