]>
git.proxmox.com Git - libgit2.git/blob - tests/refs/shorthand.c
f995d26cac79d2f5171efbc9f71198cc4d55708d
1 #include "clar_libgit2.h"
3 #include "repository.h"
5 void assert_shorthand(git_repository
*repo
, const char *refname
, const char *shorthand
)
9 cl_git_pass(git_reference_lookup(&ref
, repo
, refname
));
10 cl_assert_equal_s(git_reference_shorthand(ref
), shorthand
);
11 git_reference_free(ref
);
14 void test_refs_shorthand__0(void)
18 cl_git_pass(git_repository_open(&repo
, cl_fixture("testrepo.git")));
21 assert_shorthand(repo
, "refs/heads/master", "master");
22 assert_shorthand(repo
, "refs/tags/test", "test");
23 assert_shorthand(repo
, "refs/remotes/test/master", "test/master");
24 assert_shorthand(repo
, "refs/notes/fanout", "notes/fanout");
26 git_repository_free(repo
);