summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-08-08 13:40:17 +0200
committerVicent Marti <tanoku@gmail.com>2011-09-15 01:13:50 +0200
commit3601c4bfce3df04ebfc8668e5db531ded39280a9 (patch)
tree4fa330a2dec46c10f296b6f95838c13dfc11ec9b /include/git2
parenta9daa9bc166b1d6f7c8af78d406761c942ab47e4 (diff)
downloadlibgit2-3601c4bfce3df04ebfc8668e5db531ded39280a9.tar.gz
repository: Add git_repository_head()
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/repository.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index e4326437f..fb9b09f7e 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -219,6 +219,16 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo);
GIT_EXTERN(int) git_repository_init(git_repository **repo_out, const char *path, unsigned is_bare);
/**
+ * Retrieve and resolve the reference pointed at by HEAD.
+ *
+ * @param head_out pointer to the reference which will be retrieved
+ * @param repo a repository object
+ *
+ * @return 0 on success; error code otherwise
+ */
+GIT_EXTERN(int) git_repository_head(git_reference **head_out, git_repository *repo);
+
+/**
* Check if a repository's HEAD is detached
*
* A repository's HEAD is detached when it points directly to a commit