summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2018-05-15 23:42:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-16 02:42:03 (GMT)
commit02ba3e1a057aad2d2201dc6ba8f77f2904b07703 (patch)
treeb2664242663b3eb76783c87bb0fd80fdf28d54bc /commit.c
parent3f5787f80662b8f5dbd6fb83d5ca20be224e8a08 (diff)
downloadgit-02ba3e1a057aad2d2201dc6ba8f77f2904b07703.zip
git-02ba3e1a057aad2d2201dc6ba8f77f2904b07703.tar.gz
git-02ba3e1a057aad2d2201dc6ba8f77f2904b07703.tar.bz2
commit: add repository argument to read_graft_file
Add a repository argument to allow the caller of read_graft_file to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 4e8d348..b5c0aec 100644
--- a/commit.c
+++ b/commit.c
@@ -177,7 +177,8 @@ bad_graft_data:
return NULL;
}
-static int read_graft_file(const char *graft_file)
+#define read_graft_file(r, f) read_graft_file_##r(f)
+static int read_graft_file_the_repository(const char *graft_file)
{
FILE *fp = fopen_or_warn(graft_file, "r");
struct strbuf buf = STRBUF_INIT;
@@ -204,7 +205,7 @@ static void prepare_commit_graft(void)
if (commit_graft_prepared)
return;
graft_file = get_graft_file();
- read_graft_file(graft_file);
+ read_graft_file(the_repository, graft_file);
/* make sure shallows are read */
is_repository_shallow();
commit_graft_prepared = 1;