Merge pull request #3834 from pks-t/pks/cleanups Cleanups
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
diff --git a/src/clone.c b/src/clone.c
index 6b4b7ae..0d4756e 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -461,14 +461,6 @@ int git_clone_init_options(git_clone_options *opts, unsigned int version)
return 0;
}
-static const char *repository_base(git_repository *repo)
-{
- if (git_repository_is_bare(repo))
- return git_repository_path(repo);
-
- return git_repository_workdir(repo);
-}
-
static bool can_link(const char *src, const char *dst, int link)
{
#ifdef GIT_WIN32
diff --git a/src/diff_driver.c b/src/diff_driver.c
index bc35189..2ead551 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -59,7 +59,7 @@ static git_diff_driver global_drivers[3] = {
{ DIFF_DRIVER_TEXT, GIT_DIFF_FORCE_TEXT, 0 },
};
-git_diff_driver_registry *git_diff_driver_registry_new()
+git_diff_driver_registry *git_diff_driver_registry_new(void)
{
git_diff_driver_registry *reg =
git__calloc(1, sizeof(git_diff_driver_registry));
diff --git a/src/remote.c b/src/remote.c
index a408acb..5f89c40 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -547,53 +547,6 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
return error;
}
-static int update_config_refspec(const git_remote *remote, git_config *config, int direction)
-{
- git_buf name = GIT_BUF_INIT;
- unsigned int push;
- const char *dir;
- size_t i;
- int error = 0;
- const char *cname;
-
- push = direction == GIT_DIRECTION_PUSH;
- dir = push ? "push" : "fetch";
-
- if (git_buf_printf(&name, "remote.%s.%s", remote->name, dir) < 0)
- return -1;
- cname = git_buf_cstr(&name);
-
- /* Clear out the existing config */
- while (!error)
- error = git_config_delete_multivar(config, cname, ".*");
-
- if (error != GIT_ENOTFOUND)
- return error;
-
- for (i = 0; i < remote->refspecs.length; i++) {
- git_refspec *spec = git_vector_get(&remote->refspecs, i);
-
- if (spec->push != push)
- continue;
-
- // "$^" is a unmatcheable regexp: it will not match anything at all, so
- // all values will be considered new and we will not replace any
- // present value.
- if ((error = git_config_set_multivar(
- config, cname, "$^", spec->string)) < 0) {
- goto cleanup;
- }
- }
-
- giterr_clear();
- error = 0;
-
-cleanup:
- git_buf_free(&name);
-
- return error;
-}
-
const char *git_remote_name(const git_remote *remote)
{
assert(remote);
@@ -2103,34 +2056,6 @@ int git_remote_add_push(git_repository *repo, const char *remote, const char *re
return write_add_refspec(repo, remote, refspec, false);
}
-static int set_refspecs(git_remote *remote, git_strarray *array, int push)
-{
- git_vector *vec = &remote->refspecs;
- git_refspec *spec;
- size_t i;
-
- /* Start by removing any refspecs of the same type */
- for (i = 0; i < vec->length; i++) {
- spec = git_vector_get(vec, i);
- if (spec->push != push)
- continue;
-
- git_refspec__free(spec);
- git__free(spec);
- git_vector_remove(vec, i);
- i--;
- }
-
- /* And now we add the new ones */
-
- for (i = 0; i < array->count; i++) {
- if (add_refspec(remote, array->strings[i], !push) < 0)
- return -1;
- }
-
- return 0;
-}
-
static int copy_refspecs(git_strarray *array, const git_remote *remote, unsigned int push)
{
size_t i;
diff --git a/src/settings.c b/src/settings.c
index 0da19ea..00a3ef0 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -23,7 +23,7 @@ void git_libgit2_version(int *major, int *minor, int *rev)
*rev = LIBGIT2_VER_REVISION;
}
-int git_libgit2_features()
+int git_libgit2_features(void)
{
return 0
#ifdef GIT_THREADS
@@ -73,12 +73,12 @@ static int config_level_to_sysdir(int config_level)
extern char *git__user_agent;
extern char *git__ssl_ciphers;
-const char *git_libgit2__user_agent()
+const char *git_libgit2__user_agent(void)
{
return git__user_agent;
}
-const char *git_libgit2__ssl_ciphers()
+const char *git_libgit2__ssl_ciphers(void)
{
return git__ssl_ciphers;
}
diff --git a/tests/clar.c b/tests/clar.c
index 2caa871..4bee9f7 100644
--- a/tests/clar.c
+++ b/tests/clar.c
@@ -409,7 +409,7 @@ clar_test_init(int argc, char **argv)
}
int
-clar_test_run()
+clar_test_run(void)
{
if (_clar.argc > 1)
clar_parse_args(_clar.argc, _clar.argv);
@@ -424,7 +424,7 @@ clar_test_run()
}
void
-clar_test_shutdown()
+clar_test_shutdown(void)
{
clar_print_shutdown(
_clar.tests_ran,
diff --git a/tests/network/remote/rename.c b/tests/network/remote/rename.c
index b44a0ae..0449575 100644
--- a/tests/network/remote/rename.c
+++ b/tests/network/remote/rename.c
@@ -16,16 +16,6 @@ void test_network_remote_rename__cleanup(void)
cl_git_sandbox_cleanup();
}
-static int dont_call_me_cb(const char *fetch_refspec, void *payload)
-{
- GIT_UNUSED(fetch_refspec);
- GIT_UNUSED(payload);
-
- cl_assert(false);
-
- return -1;
-}
-
void test_network_remote_rename__renaming_a_remote_moves_related_configuration_section(void)
{
git_strarray problems = {0};