Fix GCC static/non-static compile error
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
diff --git a/src/remote.c b/src/remote.c
index 5384db6..d874d60 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -130,7 +130,28 @@ on_error:
return error;
}
-extern int ensure_remote_doesnot_exist(git_repository *repo, const char *name);
+static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
+{
+ int error;
+ git_remote *remote;
+
+ error = git_remote_load(&remote, repo, name);
+
+ if (error == GIT_ENOTFOUND)
+ return 0;
+
+ if (error < 0)
+ return error;
+
+ git_remote_free(remote);
+
+ giterr_set(
+ GITERR_CONFIG,
+ "Remote '%s' already exists.", name);
+
+ return GIT_EEXISTS;
+}
+
int git_remote_create(git_remote **out, git_repository *repo, const char *name, const char *url)
{
@@ -1091,28 +1112,6 @@ void git_remote_set_autotag(git_remote *remote, git_remote_autotag_option_t valu
remote->download_tags = value;
}
-static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
-{
- int error;
- git_remote *remote;
-
- error = git_remote_load(&remote, repo, name);
-
- if (error == GIT_ENOTFOUND)
- return 0;
-
- if (error < 0)
- return error;
-
- git_remote_free(remote);
-
- giterr_set(
- GITERR_CONFIG,
- "Remote '%s' already exists.", name);
-
- return GIT_EEXISTS;
-}
-
static int rename_remote_config_section(
git_repository *repo,
const char *old_name,