builtin/clone: move around `setup_reference()`
In a subsequent commit, `setup_reference()` will start to call `copy_alternates()`. Prepare for this by moving the function further down so that we can avoid adding a declaration. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>jch
parent
ef8fb7fd96
commit
1cd2aaa24b
|
|
@ -179,16 +179,6 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void setup_reference(void)
|
||||
{
|
||||
int required = 1;
|
||||
for_each_string_list(&option_required_reference,
|
||||
add_one_reference, &required);
|
||||
required = 0;
|
||||
for_each_string_list(&option_optional_reference,
|
||||
add_one_reference, &required);
|
||||
}
|
||||
|
||||
static void copy_alternates(struct strbuf *src, const char *src_repo)
|
||||
{
|
||||
/*
|
||||
|
|
@ -228,6 +218,16 @@ static void copy_alternates(struct strbuf *src, const char *src_repo)
|
|||
fclose(in);
|
||||
}
|
||||
|
||||
static void setup_reference(void)
|
||||
{
|
||||
int required = 1;
|
||||
for_each_string_list(&option_required_reference,
|
||||
add_one_reference, &required);
|
||||
required = 0;
|
||||
for_each_string_list(&option_optional_reference,
|
||||
add_one_reference, &required);
|
||||
}
|
||||
|
||||
static void mkdir_if_missing(const char *pathname, mode_t mode)
|
||||
{
|
||||
struct stat st;
|
||||
|
|
|
|||
Loading…
Reference in New Issue