remote: move static method
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
diff --git a/src/remote.c b/src/remote.c
index 7a07c01..0d3929a 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -189,6 +189,26 @@ static int canonicalize_url(git_buf *out, const char *in)
return git_buf_puts(out, in);
}
+static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
+{
+ int error;
+ git_remote *remote;
+
+ error = git_remote_lookup(&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 create_internal(git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch)
{
git_remote *remote;
@@ -270,29 +290,6 @@ on_error:
return error;
}
-static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
-{
- int error;
- git_remote *remote;
-
- error = git_remote_lookup(&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)
{
git_buf buf = GIT_BUF_INIT;