From 0ed572d4f529ff778e4a38b53445912c3e85d2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 3 May 2012 16:08:33 +0200 Subject: remote: add git_remote_add() Helper function to create a remote with the default settings --- include/git2/remote.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/git2/remote.h') diff --git a/include/git2/remote.h b/include/git2/remote.h index 7af4148dc..5794f8d16 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -210,6 +210,16 @@ GIT_EXTERN(int) git_remote_valid_url(const char *url); */ GIT_EXTERN(int) git_remote_list(git_strarray *remotes_list, git_repository *repo); +/** + * 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 + * @param name the remote's name + * @param url the remote's url + */ +GIT_EXTERN(int) git_remote_add(git_remote **out, git_repository *repo, const char *name, const char *url); + /** @} */ GIT_END_DECL #endif -- cgit v1.2.1 From 8e210931ca5d57b6ca7bc16b41598faa9339bc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 3 May 2012 20:25:56 +0200 Subject: remotes: change git_remote_new's signature Add a fetch refspec arguemnt and make the arguments (name, url, refspec), as that order makes more sense. --- include/git2/remote.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/git2/remote.h') diff --git a/include/git2/remote.h b/include/git2/remote.h index 5794f8d16..41ca7dbac 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -38,11 +38,12 @@ GIT_BEGIN_DECL * * @param out pointer to the new remote object * @param repo the associtated repository - * @param url the remote repository's URL * @param name the remote's name + * @param url the remote repository's URL + * @param fetch the fetch refspec to use for this remote * @return GIT_SUCCESS or an error code */ -GIT_EXTERN(int) git_remote_new(git_remote **out, git_repository *repo, const char *url, const char *name); +GIT_EXTERN(int) git_remote_new(git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch); /** * Get the information for a particular remote -- cgit v1.2.1