summaryrefslogtreecommitdiff
path: root/include/git2/remote.h
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-05-22 02:28:42 +0200
committerVicent Marti <vicent@github.com>2014-05-22 02:28:42 +0200
commita598264463442da0013d6e8b6a0c93d075e14d3a (patch)
tree0e92ceda6fb9168525181ce01ed2c70a20429e69 /include/git2/remote.h
parent7ee233a9203d09a08e269788ca4877778bc0c489 (diff)
parent2a597116583696486141261a8b459319b513facf (diff)
downloadlibgit2-a598264463442da0013d6e8b6a0c93d075e14d3a.tar.gz
Merge pull request #2376 from libgit2/cmn/remote-symref
Add support for the symref extension
Diffstat (limited to 'include/git2/remote.h')
-rw-r--r--include/git2/remote.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 07cd2e7c6..28771ac42 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -623,6 +623,24 @@ GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
*/
GIT_EXTERN(int) git_remote_delete(git_remote *remote);
+/**
+ * Retrieve the name of the remote's default branch
+ *
+ * The default branch of a repository is the branch which HEAD points
+ * to. If the remote does not support reporting this information
+ * directly, it performs the guess as git does; that is, if there are
+ * multiple branches which point to the same commit, the first one is
+ * chosen. If the master branch is a candidate, it wins.
+ *
+ * This function must only be called after connecting.
+ *
+ * @param out the buffern in which to store the reference name
+ * @param remote the remote
+ * @return 0, GIT_ENOTFOUND if the remote does not have any references
+ * or none of them point to HEAD's commit, or an error message.
+ */
+GIT_EXTERN(int) git_remote_default_branch(git_buf *out, git_remote *remote);
+
/** @} */
GIT_END_DECL
#endif