]> git.proxmox.com Git - libgit2.git/blob - tests/libgit2/refs/update.c
New upstream version 1.5.0+ds
[libgit2.git] / tests / libgit2 / refs / update.c
1 #include "clar_libgit2.h"
2
3 #include "refs.h"
4
5 static git_repository *g_repo;
6
7 void test_refs_update__initialize(void)
8 {
9 g_repo = cl_git_sandbox_init("testrepo.git");
10 }
11
12 void test_refs_update__cleanup(void)
13 {
14 cl_git_sandbox_cleanup();
15 }
16
17 void test_refs_update__updating_the_target_of_a_symref_with_an_invalid_name_returns_EINVALIDSPEC(void)
18 {
19 git_reference *head;
20
21 cl_git_pass(git_reference_lookup(&head, g_repo, GIT_HEAD_FILE));
22 cl_assert_equal_i(GIT_REFERENCE_SYMBOLIC, git_reference_type(head));
23 git_reference_free(head);
24
25 cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create(&head, g_repo, GIT_HEAD_FILE, "refs/heads/inv@{id", 1, NULL));
26 }