Commit 231f350d by Carlos Martín Nieto

remote: don't free the remote on delete

This was a bad idea. Don't free except in the free function.
parent d1544564
...@@ -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.
*/ */
......
...@@ -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;
} }
......
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment