Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
de2af3c2
Commit
de2af3c2
authored
Jun 20, 2018
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: move static method
parent
0e5a27cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
23 deletions
+20
-23
src/remote.c
+20
-23
No files found.
src/remote.c
View file @
de2af3c2
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment