Пример #1
0
void git_repository_free(git_repository *repo)
{
	git_hashtable_iterator it;
	git_object *object;

	if (repo == NULL)
		return;

	free(repo->path_workdir);
	free(repo->path_index);
	free(repo->path_repository);
	free(repo->path_odb);

	git_hashtable_iterator_init(repo->objects, &it);

	while ((object = (git_object *)
				git_hashtable_iterator_next(&it)) != NULL)
		git_object_free(object);

	git_hashtable_free(repo->objects);

	git_repository__refcache_free(&repo->references);

	if (repo->db != NULL)
		git_odb_close(repo->db);

	if (repo->index != NULL)
		git_index_free(repo->index);

	free(repo);
}
Пример #2
0
void git_repository_free(git_repository *repo)
{
	git_hashtable_iterator it;
	git_object *object;

	assert(repo);

	free(repo->path_workdir);
	free(repo->path_index);
	free(repo->path_repository);
	free(repo->path_odb);

	git_hashtable_iterator_init(repo->objects, &it);

	while ((object = (git_object *)
				git_hashtable_iterator_next(&it)) != NULL)
		git_object_free(object);

	git_hashtable_free(repo->objects);
	git_odb_close(repo->db);
	git_index_free(repo->index);
	free(repo);
}