remote: apply insteadOf configuration.

A remote's URLs are now modified according to the url.*.insteadOf
and url.*.pushInsteadOf configurations. This allows a user to
replace URL prefixes by setting the corresponding keys. E.g.
"url.foo.insteadOf = bar" would replace the prefix "bar" with the
new prefix "foo".
This commit is contained in:
Patrick Steinhardt
2015-05-31 13:21:53 +02:00
parent a5670d4f2d
commit ec0c4c4001
4 changed files with 148 additions and 5 deletions
+6
View File
@@ -120,6 +120,9 @@ GIT_EXTERN(const char *) git_remote_name(const git_remote *remote);
/**
* Get the remote's url
*
* If url.*.insteadOf has been configured for this URL, it will
* return the modified URL.
*
* @param remote the remote
* @return a pointer to the url
*/
@@ -128,6 +131,9 @@ GIT_EXTERN(const char *) git_remote_url(const git_remote *remote);
/**
* Get the remote's url for pushing
*
* If url.*.pushInsteadOf has been configured for this URL, it
* will return the modified URL.
*
* @param remote the remote
* @return a pointer to the url or NULL if no special url for pushing is set
*/