summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-04-30 11:18:16 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-04-30 12:04:59 +0200
commit1ffd0806f406a9dc300dbdefaf1e1d036a4294b4 (patch)
tree13fa5260922296d5deae8b14adafb04e8c6dff88 /include/git2
parent8d39f2a79067c9551286bb552457db71b88b64d3 (diff)
downloadlibgit2-1ffd0806f406a9dc300dbdefaf1e1d036a4294b4.tar.gz
remote: add resfpec list accessors
Bring back a way of acessing the git_refspec* from a remote. Closes #1514
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/refspec.h1
-rw-r--r--include/git2/remote.h26
2 files changed, 27 insertions, 0 deletions
diff --git a/include/git2/refspec.h b/include/git2/refspec.h
index 89ab81b02..c0b410cbf 100644
--- a/include/git2/refspec.h
+++ b/include/git2/refspec.h
@@ -9,6 +9,7 @@
#include "common.h"
#include "types.h"
+#include "net.h"
/**
* @file git2/refspec.h
diff --git a/include/git2/remote.h b/include/git2/remote.h
index f02b95678..2aa384a54 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -191,6 +191,32 @@ GIT_EXTERN(int) git_remote_get_push_refspecs(git_strarray *array, git_remote *re
GIT_EXTERN(void) git_remote_clear_refspecs(git_remote *remote);
/**
+ * Get the number of refspecs for a remote
+ *
+ * @param remote the remote
+ * @return the amount of refspecs configured in this remote
+ */
+GIT_EXTERN(size_t) git_remote_refspec_count(git_remote *remote);
+
+/**
+ * Get a refspec from the remote
+ *
+ * @param remote the remote to query
+ * @param n the refspec to get
+ * @return the nth refspec
+ */
+GIT_EXTERN(const git_refspec *)git_remote_get_refspec(git_remote *remote, size_t n);
+
+/**
+ * Remove a refspec from the remote
+ *
+ * @param remote the remote to query
+ * @param n the refspec to remove
+ * @return 0 or GIT_ENOTFOUND
+ */
+GIT_EXTERN(int) git_remote_remove_refspec(git_remote *remote, size_t n);
+
+/**
* Open a connection to a remote
*
* The transport is selected based on the URL. The direction argument