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
231f350d
Commit
231f350d
authored
Jun 06, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: don't free the remote on delete
This was a bad idea. Don't free except in the free function.
parent
d1544564
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 additions
and
5 deletions
+1
-5
include/git2/remote.h
+0
-2
src/remote.c
+0
-2
tests/network/remote/delete.c
+1
-1
No files found.
include/git2/remote.h
View file @
231f350d
...
@@ -618,8 +618,6 @@ GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
...
@@ -618,8 +618,6 @@ GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
* All remote-tracking branches and configuration settings
* All remote-tracking branches and configuration settings
* for the remote will be removed.
* for the remote will be removed.
*
*
* once deleted, the passed remote object will be freed and invalidated.
*
* @param remote A valid remote
* @param remote A valid remote
* @return 0 on success, or an error code.
* @return 0 on success, or an error code.
*/
*/
...
...
src/remote.c
View file @
231f350d
...
@@ -1921,8 +1921,6 @@ int git_remote_delete(git_remote *remote)
...
@@ -1921,8 +1921,6 @@ int git_remote_delete(git_remote *remote)
repo
,
git_remote_name
(
remote
),
NULL
))
<
0
)
repo
,
git_remote_name
(
remote
),
NULL
))
<
0
)
return
error
;
return
error
;
git_remote_free
(
remote
);
return
0
;
return
0
;
}
}
...
...
tests/network/remote/delete.c
View file @
231f350d
...
@@ -15,6 +15,7 @@ void test_network_remote_delete__initialize(void)
...
@@ -15,6 +15,7 @@ void test_network_remote_delete__initialize(void)
void
test_network_remote_delete__cleanup
(
void
)
void
test_network_remote_delete__cleanup
(
void
)
{
{
git_remote_free
(
_remote
);
cl_git_sandbox_cleanup
();
cl_git_sandbox_cleanup
();
}
}
...
@@ -27,7 +28,6 @@ void test_network_remote_delete__cannot_delete_an_anonymous_remote(void)
...
@@ -27,7 +28,6 @@ void test_network_remote_delete__cannot_delete_an_anonymous_remote(void)
cl_git_fail
(
git_remote_delete
(
remote
));
cl_git_fail
(
git_remote_delete
(
remote
));
git_remote_free
(
remote
);
git_remote_free
(
remote
);
git_remote_free
(
_remote
);
}
}
void
test_network_remote_delete__remove_remote_tracking_branches
(
void
)
void
test_network_remote_delete__remove_remote_tracking_branches
(
void
)
...
...
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