Beispiel #1
0
static VALUE rb_git_index_init(VALUE self, VALUE path)
{
	git_index *index;
	int error;

	error = git_index_open_bare(&index, RSTRING_PTR(path));
	rugged_exception_check(error);

	DATA_PTR(self) = index;
	return Qnil;
}
Beispiel #2
0
	git_off_t file_size;
	time_t mtime;
};

struct test_entry TEST_ENTRIES[] = {
	{4, "Makefile", 5064, 0x4C3F7F33},
	{62, "tests/Makefile", 2631, 0x4C3F7F33},
	{36, "src/index.c", 10014, 0x4C43368D},
	{6, "git.git-authors", 2709, 0x4C3F7F33},
	{48, "src/revobject.h", 1448, 0x4C3F7FE2}
};

BEGIN_TEST("read", index_loadempty_test)
	git_index *index;

	must_pass(git_index_open_bare(&index, "in-memory-index"));
	must_be_true(index->on_disk == 0);

	must_pass(git_index_read(index));

	must_be_true(index->on_disk == 0);
	must_be_true(git_index_entrycount(index) == 0);
	must_be_true(index->sorted);

	git_index_free(index);
END_TEST

BEGIN_TEST("read", index_load_test)
	git_index *index;
	unsigned int i;
	git_index_entry **entries;