Sha256: b026bad5001d012861035ab2fee66a7b7b9bc693f2e21ab1baa850b317dea204

Contents?: true

Size: 953 Bytes

Versions: 2

Compression:

Stored size: 953 Bytes

Contents

#include "clar_libgit2.h"

#include "filebuf.h"
#include "fileops.h"
#include "posix.h"

#define TEST_CONFIG "git-new-config"

void test_config_new__write_new_config(void)
{
	const char *out;
	struct git_config_file *file;
	git_config *config;

	cl_git_pass(git_config_file__ondisk(&file, TEST_CONFIG));
	cl_git_pass(git_config_new(&config));
	cl_git_pass(git_config_add_file(config, file, 0));

	cl_git_pass(git_config_set_string(config, "color.ui", "auto"));
	cl_git_pass(git_config_set_string(config, "core.editor", "ed"));

	git_config_free(config);

	cl_git_pass(git_config_file__ondisk(&file, TEST_CONFIG));
	cl_git_pass(git_config_new(&config));
	cl_git_pass(git_config_add_file(config, file, 0));

	cl_git_pass(git_config_get_string(&out, config, "color.ui"));
	cl_assert_equal_s(out, "auto");
	cl_git_pass(git_config_get_string(&out, config, "core.editor"));
	cl_assert_equal_s(out, "ed");

	git_config_free(config);

	p_unlink(TEST_CONFIG);
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rugged-0.17.0b2 ext/rugged/vendor/libgit2-dist/tests-clar/config/new.c
rugged-0.17.0b1 ext/rugged/vendor/libgit2-dist/tests-clar/config/new.c