remote: remove url and pushurl from the save logic

As a first step in removing the repository-saving logic, don't allow
chaning the url or push url from a remote object, but change the
configuration on the configuration immediately.
This commit is contained in:
Carlos Martín Nieto
2015-05-13 09:46:36 +02:00
parent 8f0104ecc5
commit 22261344de
5 changed files with 87 additions and 57 deletions
+14 -10
View File
@@ -153,26 +153,30 @@ GIT_EXTERN(const char *) git_remote_url(const git_remote *remote);
GIT_EXTERN(const char *) git_remote_pushurl(const git_remote *remote);
/**
* Set the remote's url
* Set the remote's url in the configuration
*
* Existing connections will not be updated.
* Remote objects already in memory will not be affected. This assumes
* the common case of a single-url remote and will otherwise return an error.
*
* @param remote the remote
* @param repo the repository in which to perform the change
* @param remote the remote's name
* @param url the url to set
* @return 0 or an error value
*/
GIT_EXTERN(int) git_remote_set_url(git_remote *remote, const char* url);
GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char* url);
/**
* Set the remote's url for pushing
* Set the remote's url for pushing in the configuration.
*
* Existing connections will not be updated.
* Remote objects already in memory will not be affected. This assumes
* the common case of a single-url remote and will otherwise return an error.
*
* @param remote the remote
* @param url the url to set or NULL to clear the pushurl
* @return 0 or an error value
*
* @param repo the repository in which to perform the change
* @param remote the remote's name
* @param url the url to set
*/
GIT_EXTERN(int) git_remote_set_pushurl(git_remote *remote, const char* url);
GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url);
/**
* Add a fetch refspec to the remote