diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-04-20 18:49:11 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-04-20 19:45:40 +0200 |
commit | bc6374eac485ab9ad9cfd7165b6d071c3dcb673a (patch) | |
tree | 8ba82d9d64953384895afb1e26a33c3c7d5c6832 /include/git2/remote.h | |
parent | 4330ab26b53c0e1bf8cbb5e65704f65e3d116eba (diff) | |
download | libgit2-bc6374eac485ab9ad9cfd7165b6d071c3dcb673a.tar.gz |
remote: allow querying for refspecs
Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs
from the remote and rename the refspec-adding functions to a less
silly name.
Use this instead of the vector index hacks in the tests.
Diffstat (limited to 'include/git2/remote.h')
-rw-r--r-- | include/git2/remote.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 7a161796f..5dcd93099 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -148,7 +148,18 @@ GIT_EXTERN(int) git_remote_set_pushurl(git_remote *remote, const char* url); * @apram refspec the new fetch refspec * @return 0 or an error value */ -GIT_EXTERN(int) git_remote_add_fetchspec(git_remote *remote, const char *refspec); +GIT_EXTERN(int) git_remote_add_fetch(git_remote *remote, const char *refspec); + +/** + * Get the remote's list of fetch refspecs + * + * The memory is owned by the user and should be freed with + * `git_strarray_free`. + * + * @param array pointer to the array in which to store the strings + * @param remote the remote to query + */ +GIT_EXTERN(int) git_remote_get_fetch_refspecs(git_strarray *array, git_remote *remote); /** * Add a push refspec to the remote @@ -157,7 +168,18 @@ GIT_EXTERN(int) git_remote_add_fetchspec(git_remote *remote, const char *refspec * @param refspec the new push refspec * @return 0 or an error value */ -GIT_EXTERN(int) git_remote_add_pushspec(git_remote *remote, const char *refspec); +GIT_EXTERN(int) git_remote_add_push(git_remote *remote, const char *refspec); + +/** + * Get the remote's list of push refspecs + * + * The memory is owned by the user and should be freed with + * `git_strarray_free`. + * + * @param array pointer to the array in which to store the strings + * @param remote the remote to query + */ +GIT_EXTERN(int) git_remote_get_push_refspecs(git_strarray *array, git_remote *remote); /** * Get the push refspec |