Welcome to mirror list, hosted at ThFree Co, Russian Federation.

describe_helpers.c « describe « tests - github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7235d320f2bc4fa569076ee785a58d111ef6d3b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "describe_helpers.h"

void assert_describe(
	const char *expected_output,
	const char *revparse_spec,
	git_repository *repo,
	git_describe_opts *opts,
	bool is_prefix_match)
{
	git_object *object;
	git_buf label;

	cl_git_pass(git_revparse_single(&object, repo, revparse_spec));

	cl_git_pass(git_describe_commit(&label, object, opts));

	if (is_prefix_match)
		cl_assert_equal_i(0, git__prefixcmp(git_buf_cstr(&label), expected_output));
	else
		cl_assert_equal_s(expected_output, label);

	git_object_free(object);
	git_buf_free(&label);
}