mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 06:20:56 +00:00
Fix GCC static/non-static compile error
This commit is contained in:
parent
19c3c99ca8
commit
592f466c48
45
src/remote.c
45
src/remote.c
@ -130,7 +130,28 @@ on_error:
|
|||||||
return 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)
|
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;
|
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(
|
static int rename_remote_config_section(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
const char *old_name,
|
const char *old_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user