Skip to content

Commit fe345c7

Browse files
committed
Remove unused static functions
1 parent 8fd74c0 commit fe345c7

File tree

3 files changed

+0
-93
lines changed

3 files changed

+0
-93
lines changed

src/clone.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,6 @@ int git_clone_init_options(git_clone_options *opts, unsigned int version)
461461
return 0;
462462
}
463463

464-
static const char *repository_base(git_repository *repo)
465-
{
466-
if (git_repository_is_bare(repo))
467-
return git_repository_path(repo);
468-
469-
return git_repository_workdir(repo);
470-
}
471-
472464
static bool can_link(const char *src, const char *dst, int link)
473465
{
474466
#ifdef GIT_WIN32

src/remote.c

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -547,53 +547,6 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
547547
return error;
548548
}
549549

550-
static int update_config_refspec(const git_remote *remote, git_config *config, int direction)
551-
{
552-
git_buf name = GIT_BUF_INIT;
553-
unsigned int push;
554-
const char *dir;
555-
size_t i;
556-
int error = 0;
557-
const char *cname;
558-
559-
push = direction == GIT_DIRECTION_PUSH;
560-
dir = push ? "push" : "fetch";
561-
562-
if (git_buf_printf(&name, "remote.%s.%s", remote->name, dir) < 0)
563-
return -1;
564-
cname = git_buf_cstr(&name);
565-
566-
/* Clear out the existing config */
567-
while (!error)
568-
error = git_config_delete_multivar(config, cname, ".*");
569-
570-
if (error != GIT_ENOTFOUND)
571-
return error;
572-
573-
for (i = 0; i < remote->refspecs.length; i++) {
574-
git_refspec *spec = git_vector_get(&remote->refspecs, i);
575-
576-
if (spec->push != push)
577-
continue;
578-
579-
// "$^" is a unmatcheable regexp: it will not match anything at all, so
580-
// all values will be considered new and we will not replace any
581-
// present value.
582-
if ((error = git_config_set_multivar(
583-
config, cname, "$^", spec->string)) < 0) {
584-
goto cleanup;
585-
}
586-
}
587-
588-
giterr_clear();
589-
error = 0;
590-
591-
cleanup:
592-
git_buf_free(&name);
593-
594-
return error;
595-
}
596-
597550
const char *git_remote_name(const git_remote *remote)
598551
{
599552
assert(remote);
@@ -2103,34 +2056,6 @@ int git_remote_add_push(git_repository *repo, const char *remote, const char *re
21032056
return write_add_refspec(repo, remote, refspec, false);
21042057
}
21052058

2106-
static int set_refspecs(git_remote *remote, git_strarray *array, int push)
2107-
{
2108-
git_vector *vec = &remote->refspecs;
2109-
git_refspec *spec;
2110-
size_t i;
2111-
2112-
/* Start by removing any refspecs of the same type */
2113-
for (i = 0; i < vec->length; i++) {
2114-
spec = git_vector_get(vec, i);
2115-
if (spec->push != push)
2116-
continue;
2117-
2118-
git_refspec__free(spec);
2119-
git__free(spec);
2120-
git_vector_remove(vec, i);
2121-
i--;
2122-
}
2123-
2124-
/* And now we add the new ones */
2125-
2126-
for (i = 0; i < array->count; i++) {
2127-
if (add_refspec(remote, array->strings[i], !push) < 0)
2128-
return -1;
2129-
}
2130-
2131-
return 0;
2132-
}
2133-
21342059
static int copy_refspecs(git_strarray *array, const git_remote *remote, unsigned int push)
21352060
{
21362061
size_t i;

tests/network/remote/rename.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ void test_network_remote_rename__cleanup(void)
1616
cl_git_sandbox_cleanup();
1717
}
1818

19-
static int dont_call_me_cb(const char *fetch_refspec, void *payload)
20-
{
21-
GIT_UNUSED(fetch_refspec);
22-
GIT_UNUSED(payload);
23-
24-
cl_assert(false);
25-
26-
return -1;
27-
}
28-
2919
void test_network_remote_rename__renaming_a_remote_moves_related_configuration_section(void)
3020
{
3121
git_strarray problems = {0};

0 commit comments

Comments
 (0)