diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-12 03:14:51 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-12 03:14:51 +0400 |
commit | b1a3a70ed1ca45bb155ec4c10b40a047d27614f3 (patch) | |
tree | c6a6065e66ff80c7eb5665e2dd7bfe467f3b9655 /tests-clar/repo/head.c | |
parent | ef8871515bcb8af8d690609c086718bcaecbb5c6 (diff) |
repository: Refine repository_head() error report
Diffstat (limited to 'tests-clar/repo/head.c')
-rw-r--r-- | tests-clar/repo/head.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests-clar/repo/head.c b/tests-clar/repo/head.c index 58f525e2b..551e834f2 100644 --- a/tests-clar/repo/head.c +++ b/tests-clar/repo/head.c @@ -1,6 +1,7 @@ #include "clar_libgit2.h" #include "refs.h" #include "repo_helpers.h" +#include "posix.h" git_repository *repo; @@ -178,6 +179,15 @@ void test_repo_head__retrieving_an_orphaned_head_returns_GIT_EORPHANEDHEAD(void) cl_assert_equal_i(GIT_EORPHANEDHEAD, git_repository_head(&head, repo)); } +void test_repo_head__retrieving_a_missing_head_returns_GIT_ENOTFOUND(void) +{ + git_reference *head; + + delete_head(repo); + + cl_assert_equal_i(GIT_ENOTFOUND, git_repository_head(&head, repo)); +} + void test_repo_head__can_tell_if_an_orphaned_head_is_detached(void) { make_head_orphaned(repo, NON_EXISTING_HEAD); |