Commit Graph

13 Commits

Author SHA1 Message Date
nulltoken
4a34b3a9ff Add two new accessors to the repository
git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.
2011-04-09 15:25:24 -07:00
Vicent Marti
41233c40c0 Add new method git_repository_is_empty 2011-04-08 12:42:18 -07:00
nulltoken
a8375f5322 Add test exercising the opening of an standard repository initialized by git 2011-03-23 00:25:05 +02:00
nulltoken
2ce44b67f3 Add test exercising the opening of an empty bare repository initialized by git 2011-03-23 00:25:04 +02:00
nulltoken
f428ae615b Slightly enforce copy_recurs() behavior
The folder creation is now decorrelated from the recursive parsing of the source tree structure.
2011-03-23 00:25:04 +02:00
nulltoken
ba1bdf86e7 Improve test coverage of new path prettifying behavior 2011-03-23 00:24:51 +02:00
nulltoken
c90292ce4f Change gitfo_prettify_dir_path() and gitfo_prettify_file_path() behavior
Those functions now return prettified rooted path.
2011-03-23 00:17:24 +02:00
nulltoken
677a3c07f4 Add failing test for issue 84
see https://github.com/libgit2/libgit2/issues#issue/84
2011-03-23 00:17:24 +02:00
Tim Clem
45314a7e4a clean up temp repo for t12-repo tests
add actual must_pass calls back into the repo tests and remove ./ from
beginning of temp repo path
2011-03-04 23:31:28 -08:00
Vicent Marti
3dccfed163 Cleanup the testing toolkit
Tests are now declared with detailed descriptions and a short test name:

	BEGIN_TEST(the_test0, "this is an example test that does something")
		...
	END_TEST

Modules are declared through a simple macro interface:

	BEGIN_MODULE(mod_name)
		ADD_TEST(the_test0);
		...
	END_MODULE

Error messages when tests fail have been greatly improved.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-03-03 20:23:52 +02:00
nulltoken
7167422cbf Refactored some test related constants. 2011-03-03 20:23:50 +02:00
nulltoken
705a90ec9e Added tests to exercise the initialization and the opening of a repository. 2011-03-03 20:23:50 +02:00
Vicent Marti
d4b5a4e23a Internal changes on the backend system
The priority value for different backends has been removed from the
public `git_odb_backend` struct. We handle that internally. The priority
value is specified on the `git_odb_add_alternate`.

This is convenient because it allows us to poll a backend twice with
different priorities without having to instantiate it twice.

We also differentiate between main backends and alternates; alternates have
lower priority and cannot be written to.

These changes come with some unit tests to make sure that the backend
sorting is consistent.

The libgit2 version has been bumped to 0.4.0.

This commit changes the external API:

CHANGED:
	struct git_odb_backend
		No longer has a `priority` attribute; priority for the backend
		in managed internally by the library.

	git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int priority)
		Now takes an additional priority parameter, the priority that
		will be given to the backend.

ADDED:
	git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority)
		Add a backend as an alternate. Alternate backends have always
		lower priority than main backends, and writing is disabled on
		them.

Signed-off-by: Vicent Marti <tanoku@gmail.com>

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-09 19:49:38 +02:00