File: shorthand.c

package info (click to toggle)
monodevelop 5.10.0.871-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 272,040 kB
  • ctags: 258,152
  • sloc: cs: 1,439,098; xml: 947,206; ansic: 148,611; java: 64,114; makefile: 4,256; lisp: 3,174; python: 2,072; sh: 2,058; objc: 302; sql: 111; php: 65
file content (27 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "clar_libgit2.h"

#include "repository.h"

void assert_shorthand(git_repository *repo, const char *refname, const char *shorthand)
{
	git_reference *ref;

	cl_git_pass(git_reference_lookup(&ref, repo, refname));
	cl_assert_equal_s(git_reference_shorthand(ref), shorthand);
	git_reference_free(ref);
}

void test_refs_shorthand__0(void)
{
	git_repository *repo;

	cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));


	assert_shorthand(repo, "refs/heads/master", "master");
	assert_shorthand(repo, "refs/tags/test", "test");
	assert_shorthand(repo, "refs/remotes/test/master", "test/master");
	assert_shorthand(repo, "refs/notes/fanout", "notes/fanout");

	git_repository_free(repo);
}