diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-09-15 22:03:31 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-09-17 10:48:34 +0200 |
| commit | 3f4c3072ea36877c07380d096d6277e9777f4587 (patch) | |
| tree | c7ecadd96c222b17963d3524f54cff73270877eb /include/git2 | |
| parent | cc548c7b0ff0d8b33a44d90316abe0027cb6c7d9 (diff) | |
| download | libgit2-3f4c3072ea36877c07380d096d6277e9777f4587.tar.gz | |
repository: introduce git_repository_detach_head()
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/repository.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index a536c1398..e68e0548f 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -506,6 +506,25 @@ GIT_EXTERN(int) git_repository_hashfile( git_otype type, const char *as_path); +/** + * Detach the HEAD. + * + * If the HEAD is already detached and points to a Commit, 0 is returned. + * + * If the HEAD is already detached and points to a Tag, the HEAD is + * updated into making it point to the peeled Commit, and 0 is returned. + * + * If the HEAD is already detached and points to a non commitish, the HEAD is + * unaletered, and -1 is returned. + * + * Otherwise, the HEAD will be detached and point to the peeled Commit. + * + * @param repo Repository pointer + * @return 0 on success, or an error code + */ +GIT_EXTERN(int) git_repository_detach_head( + git_repository* repo); + /** @} */ GIT_END_DECL #endif |
