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
a4b6452a
Commit
a4b6452a
authored
Apr 23, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: remove git_remote_save()
It has now become a no-op, so remove the function and all references to it.
parent
77254990
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
54 deletions
+2
-54
include/git2/remote.h
+2
-15
src/clone.c
+0
-3
src/remote.c
+0
-24
tests/network/remote/remotes.c
+0
-12
No files found.
include/git2/remote.h
View file @
a4b6452a
...
...
@@ -28,8 +28,7 @@ GIT_BEGIN_DECL
typedef
int
(
*
git_remote_rename_problem_cb
)(
const
char
*
problematic_refspec
,
void
*
payload
);
/**
* Add a remote with the default fetch refspec to the repository's configuration. This
* calls git_remote_save before returning.
* Add a remote with the default fetch refspec to the repository's configuration.
*
* @param out the resulting remote
* @param repo the repository in which to create the remote
...
...
@@ -45,8 +44,7 @@ GIT_EXTERN(int) git_remote_create(
/**
* Add a remote with the provided fetch refspec (or default if NULL) to the repository's
* configuration. This
* calls git_remote_save before returning.
* configuration.
*
* @param out the resulting remote
* @param repo the repository in which to create the remote
...
...
@@ -98,17 +96,6 @@ GIT_EXTERN(int) git_remote_create_anonymous(
GIT_EXTERN
(
int
)
git_remote_lookup
(
git_remote
**
out
,
git_repository
*
repo
,
const
char
*
name
);
/**
* Save a remote to its repository's configuration
*
* One can't save a in-memory remote. Doing so will
* result in a GIT_EINVALIDSPEC being returned.
*
* @param remote the remote to save to config
* @return 0, GIT_EINVALIDSPEC or an error code
*/
GIT_EXTERN
(
int
)
git_remote_save
(
const
git_remote
*
remote
);
/**
* Create a copy of an existing remote. All internal strings are also
* duplicated. Callbacks are not duplicated.
*
...
...
src/clone.c
View file @
a4b6452a
...
...
@@ -279,9 +279,6 @@ static int create_and_configure_origin(
if
((
error
=
remote_create
(
&
origin
,
repo
,
"origin"
,
url
,
payload
))
<
0
)
goto
on_error
;
if
((
error
=
git_remote_save
(
origin
))
<
0
)
goto
on_error
;
*
out
=
origin
;
return
0
;
...
...
src/remote.c
View file @
a4b6452a
...
...
@@ -302,9 +302,6 @@ int git_remote_create_with_fetchspec(git_remote **out, git_repository *repo, con
if
(
create_internal
(
&
remote
,
repo
,
name
,
url
,
fetch
)
<
0
)
goto
on_error
;
if
(
git_remote_save
(
remote
)
<
0
)
goto
on_error
;
*
out
=
remote
;
return
0
;
...
...
@@ -595,27 +592,6 @@ cleanup:
return
error
;
}
int
git_remote_save
(
const
git_remote
*
remote
)
{
int
error
;
git_config
*
cfg
;
assert
(
remote
);
if
(
!
remote
->
name
)
{
giterr_set
(
GITERR_INVALID
,
"Can't save an anonymous remote."
);
return
GIT_EINVALIDSPEC
;
}
if
((
error
=
ensure_remote_name_is_valid
(
remote
->
name
))
<
0
)
return
error
;
if
((
error
=
git_repository_config__weakptr
(
&
cfg
,
remote
->
repo
))
<
0
)
return
error
;
return
error
;
}
const
char
*
git_remote_name
(
const
git_remote
*
remote
)
{
assert
(
remote
);
...
...
tests/network/remote/remotes.c
View file @
a4b6452a
...
...
@@ -319,18 +319,6 @@ void test_network_remote_remotes__cannot_add_a_nameless_remote(void)
git_remote_create
(
&
remote
,
_repo
,
NULL
,
"git://github.com/libgit2/libgit2"
));
}
void
test_network_remote_remotes__cannot_save_an_inmemory_remote
(
void
)
{
git_remote
*
remote
;
cl_git_pass
(
git_remote_create_anonymous
(
&
remote
,
_repo
,
"git://github.com/libgit2/libgit2"
,
NULL
));
cl_assert_equal_p
(
NULL
,
git_remote_name
(
remote
));
cl_git_fail
(
git_remote_save
(
remote
));
git_remote_free
(
remote
);
}
void
test_network_remote_remotes__cannot_add_a_remote_with_an_invalid_name
(
void
)
{
git_remote
*
remote
=
NULL
;
...
...
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