diff options
author | Edward Thomson <ethomson@github.com> | 2016-06-03 14:18:08 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2016-06-03 14:18:08 -0500 |
commit | 5afe1873488b43a0658bf3816565a19d075e0182 (patch) | |
tree | 2ea69b0b95c2fe4f642788e30045bb8aa98d3740 /tests | |
parent | 0aaba445933bed0ab046009fe6c4aca1aaf7c6b9 (diff) | |
download | libgit2-ethomson/unborn_head.tar.gz |
repository_head: return HEAD when on unborn branchethomson/unborn_head
When we're on an unborn branch, correctly set the out param so that
callers can determine what the unborn branch is.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/repo/head.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/repo/head.c b/tests/repo/head.c index 31c228777..7acdeff70 100644 --- a/tests/repo/head.c +++ b/tests/repo/head.c @@ -79,6 +79,11 @@ void test_repo_head__set_head_Attaches_HEAD_to_un_unborn_branch_when_the_branch_ cl_assert_equal_i(false, git_repository_head_detached(repo)); cl_assert_equal_i(GIT_EUNBORNBRANCH, git_repository_head(&head, repo)); + + cl_assert(head); + cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head)); + cl_assert_equal_s("HEAD", git_reference_name(head)); + cl_assert_equal_s("refs/heads/doesnt/exist/yet", git_reference_symbolic_target(head)); } void test_repo_head__set_head_Returns_ENOTFOUND_when_the_reference_doesnt_exist(void) |