File: new.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-- 698 bytes parent folder | download | duplicates (7)
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 "git2/sys/repository.h"

void test_repo_new__has_nothing(void)
{
	git_repository *repo;

	cl_git_pass(git_repository_new(&repo));
	cl_assert_equal_b(true, git_repository_is_bare(repo));
	cl_assert_equal_p(NULL, git_repository_path(repo));
	cl_assert_equal_p(NULL, git_repository_workdir(repo));
	git_repository_free(repo);
}

void test_repo_new__is_bare_until_workdir_set(void)
{
	git_repository *repo;

	cl_git_pass(git_repository_new(&repo));
	cl_assert_equal_b(true, git_repository_is_bare(repo));

	cl_git_pass(git_repository_set_workdir(repo, clar_sandbox_path(), 0));
	cl_assert_equal_b(false, git_repository_is_bare(repo));

	git_repository_free(repo);
}