tests


Log

Author Commit Date CI Message
Vicent Marti d6b5f5cc 2011-03-05T23:54:49 Add `git_oid_shorten` Set of methods to find the minimal-length to uniquely identify every OID in a list. Includes stress test. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Tim Clem 45314a7e 2011-03-04T23:13:02 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
Vicent Marti 48c27f86 2011-02-28T16:51:17 Implement reference counting for git_objects All `git_object` instances looked up from the repository are reference counted. User is expected to use the new `git_object_close` when an object is no longer needed to force freeing it. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 86d7e1ca 2011-02-28T12:46:13 Fix searching in git_vector We now store only one sorting callback that does entry comparison. This is used when sorting the entries using a quicksort, and when looking for a specific entry with the new search methods. The following search methods now exist: git_vector_search(vector, entry) git_vector_search2(vector, custom_search_callback, key) git_vector_bsearch(vector, entry) git_vector_bsearch2(vector, custom_search_callback, key) The sorting state of the vector is now stored internally. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 5de079b8 2011-02-28T12:12:26 Change the object creation/lookup API The methods previously known as git_repository_lookup git_repository_newobject git_repository_lookup_ref are now part of their respective namespaces: git_object_lookup git_object_new git_reference_lookup This makes the API more consistent with the new references API. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 3dccfed1 2011-03-03T18:19:05 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>
nulltoken 8fc05096 2011-03-03T19:59:25 Add test deleteref::deleting_a_ref_which_is_both_packed_and_loose_should_remove_both_tracks_in_the_filesystem()
nulltoken d561403f 2011-03-03T19:57:12 Add test for corner case in reference renaming
nulltoken 268bee3d 2011-03-03T19:54:34 Add test renameref::rename_a_loose_reference()
nulltoken 6b02b215 2011-03-03T19:43:47 Add test renameref::can_not_rename_a_reference_with_an_invalid_name()
nulltoken 65cc1f44 2011-03-03T19:42:11 Add test renameref::can_not_rename_a_reference_with_an_invalid_name()
nulltoken de05ff6c 2011-03-03T19:40:01 Add test renameref::renaming_a_packed_reference_makes_it_loose()
nulltoken 669db21b 2011-02-28T22:21:18 Slightly changed the behavior of git__joinpath() and git__joinpath_n().
nulltoken 52b2c209 2011-03-03T19:37:40 Enhance the packrefs::create_packfile() test
nulltoken e4029c52 2011-02-28T12:33:47 Added copydir_recurs() to test_helpers.c Test helper function which recursively copies the content of a directory. This function has been tweaked to prevent stack overflows by reusing the same path buffers on all recursive calls.
nulltoken 705a90ec 2011-02-26T14:07:13 Added tests to exercise the initialization and the opening of a repository.
nulltoken c38f9013 2011-02-26T13:56:57 Removed a duplicate constant.
nulltoken 3b3a1017 2011-02-25T21:58:25 Added rmdir_recurs(), a test helper function which recursively removes the content of a directory.
nulltoken 47d0db78 2011-02-25T15:09:31 Added some dirname and basename tests to ensure that trailing slashes are ignored.
Vicent Marti 87d3acf4 2011-02-27T22:31:43 Finish the References API The following methods have been implemented: git_reference_packall git_reference_rename git_reference_delete The library now has full support for packed references, including partial and total writing. Internal documentation has been updated with the details. Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 7167422c 2011-02-28T12:16:44 Refactored some test related constants.
nulltoken 9b3985fa 2011-02-25T10:29:11 Slightly enhanced the readability of some reference related tests.
nulltoken b0a83143 2011-02-25T10:06:49 Removed duplicate tests.
Vicent Marti 86194b24 2011-02-18T21:57:53 Split packed from unpacked references These two reference types are now stored separately to eventually allow the removal/renaming of loose references and rewriting of the refs packfile. Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 2de3b35c 2011-02-14T22:32:02 Added test covering creation of nested symbolic references.
nulltoken 1d8cc731 2011-02-14T22:29:22 Refactored the reference creation API.
nulltoken e1be1028 2011-02-13T20:18:35 Added some more tests to ensure the correct behavior of git_reference__normalize_name().
nulltoken 77600378 2011-02-13T14:51:45 Fixed line endings (CRLF->LF).
nulltoken aa2120e9 2011-02-10T15:08:00 Added git_reference__normalize_name() along with tests.
Vicent Marti fc658755 2011-02-22T21:59:36 Rewrite git_hashtable internals The old hash table with chained buckets has been replaced by a new one using Cuckoo hashing, which offers guaranteed constant lookup times. This should improve speeds on most use cases, since hash tables in libgit2 are usually used as caches where the objects are stored once and queried several times. The Cuckoo hash implementation is based off the one in the Basekit library [1] for the IO language, but rewritten to support an arbritrary number of hashes. We currently use 3 to maximize the usage of the nodes pool. [1]: https://github.com/stevedekorte/basekit/blob/master/source/CHash.c Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 4378e8d4 2011-02-22T15:15:35 Add unit test for writing a big index file Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 348c7335 2011-02-17T21:32:00 Improve the performance when writing Index files In response to issue #60 (git_index_write really slow), the write_index function has been rewritten to improve its performance -- it should now be in par with the performance of git.git. On top of that, if Posix Threads are available when compiling libgit2, a new threaded writing system will be used (3 separate threads take care of solving byte-endianness, hashing the contents of the index and writing to disk, respectively). For very long Index files, this method is up to 3x times faster than git.git. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti d4b5a4e2 2011-02-09T19:49:02 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>
Vicent Marti 995f9c34 2011-02-09T12:43:19 Use the new git__joinpath to build paths in methods The `git__joinpath` function has been changed to use a statically allocated buffer; we assume the buffer to be 4096 bytes, because fuck you. The new method also supports an arbritrary number of paths to join, which may come in handy in the future. Some methods which were manually joining paths with `strcpy` now use the new function, namely those in `index.c` and `refs.c`. Based on Emeric Fermas' original patch, which was using the old `git__joinpath` because I'm stupid. Thanks! Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 1b7124f8 2011-02-07T17:37:54 Added tests exercising git_reference_write() to create a new symbolic reference and a new object id reference.
Vicent Marti 2e75e156 2011-02-07T08:04:32 Merge branch 'refs-handling-tests' of https://github.com/nulltoken/libgit2
nulltoken fc8afc87 2011-02-06T07:48:17 Fix a memory leak in git__joinpath() tests.
nulltoken a79e8e63 2011-02-05T19:22:44 Fixed a small issue in git__join_path(). Added tests to exercise git__join_path().
nulltoken ca0fb40a 2011-02-05T17:18:27 Made test index_write_test() remove the test file it has created. It can now be run twice in a row without failing.
Vicent Marti c041af95 2011-02-05T19:45:57 Add support for SQLite backends Configure again the build system to look for SQLite3. If the library is found, the SQLite backend will be automatically compiled. Enjoy *very* fast reads and writes. MASTER PROTIP: Initialize the backend with ":memory" as the path to the SQLite database for fully-hosted in-memory repositories. Rejoice. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 95901128 2011-02-05T18:17:01 Move data from t03 to a separate header Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 1af8c748 2011-02-05T15:24:08 Enforced refs handling tests. - Added a test to ensure that a nested symbolic reference is properly resolved. - Added comparisons of object ids.
Vicent Marti f725931b 2011-02-05T12:42:41 Fix directory/path manipulation methods The `dirname` and `dirbase` methods have been replaced with the Android implementation, which is actually compilant to some kind of standard. A new method `topdir` has been added, which returns the topmost directory in a path. These changes fix issue #49: `gitfo_prettify_dir_path` converts "./.git/" to ".git/", so the code at src/repository.c:190 goes out of bounds when trying to find the topmost directory. The new `git__topdir` method handles this gracefully, and the fixed `git__dirname` now returns the proper value for the repository's working dir. E.g. /repo/.git/ ==> working dir '/repo/' .git/ ==> working dir '.' Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti c836c332 2011-02-05T09:29:37 Make more methods return error codes git_revwalk_next now returns an error code when the iteration is over. git_repository_index now returns an error code when the index file could not be opened. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 87d82994 2011-02-02T02:32:21 Make the test return an error code on failure Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 2a1732b4 2011-02-02T02:15:25 Rewrite the unit testing suite NIH Enterprises presents: a new testing system based on CuTesT, which is faster than our previous one and fortunately uses no preprocessing on the source files, which means we can run that from CMake. The test suites have been gathered together into bigger files (one file per suite, testing each of the different submodules of the library). Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 2f8a8ab2 2011-01-29T01:56:25 Refactor reference parsing code Several changes have been committed to allow the user to create in-memory references and write back to disk. Peeling of symbolic references has been made explicit. Added getter and setter methods for all attributes on a reference. Added corresponding documentation. Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 9282e921 2010-12-27T20:34:19 Merge nulltoken's reference parsing code All the commits have been squashed into a single one before refactoring the final code, to keep everything tidy. Individual commit messages are as follows: Added repository reference looking up functionality placeholder. Added basic reference database definition and caching infrastructure. Removed useless constant. Added GIT_EINVALIDREFNAME error and description. Added missing description for GIT_EBAREINDEX. Added GIT_EREFCORRUPTED error and description. Added GIT_ETOONESTEDSYMREF error and description. Added resolving of direct and symbolic references. Prepared the packed-refs parsing. Added parsing of the packed-refs file content. When no loose reference has been found, the full content of the packed-refs file is parsed. All of the new (i.e. not previously parsed as a loose reference) references are eagerly stored in the cached references storage. The method packed_reference_file__parse() is in deer need of some refactoring. :-) Extracted to a method the parsing of the peeled target of a tag. Extracted to a method the parsing of a standard packed ref. Fixed leaky removal of the cached references. Ensured that a previously parsed packed reference isn't returned if a more up-to-date loose reference exists. Enhanced documentation of git_repository_reference_lookup(). Moved some refs related constants from repository.c to refs.h. Made parsing of a packed tag reference more robust. Updated git_repository_reference_lookup() documentation. Added some references to the test repository. Added some tests covering tag references looking up. Added some tests covering symbolic and head references looking up. Added some tests covering packed references looking up.
nulltoken 2e6fd09c 2011-01-25T21:52:24 Fixed naming convention related issue.
nulltoken 618818dc 2011-01-23T16:15:11 Added git_prettify_file_path().
nulltoken ae7ffea9 2011-01-22T14:04:32 Fixed a parsing issue in git_prettify_dir_path().
Vicent Marti b29e8f19 2011-01-29T02:12:59 Return the created entry in git_tree_add_entry() Yes, we are breaking the API. Alpha software, deal with it. We need a way of getting a pointer to each newly added entry to the index, because manually looking up the entry after creation is outrageously expensive. Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken e16c2f6a 2011-01-20T19:51:34 Small enhancements to git_prettify_dir_path(). - Secured buffer ahead reading. - Guard against potential multiple dot path traversal (cf http://cwe.mitre.org/data/definitions/33.html)
Vicent Marti e08b246c 2011-01-19T17:20:39 Fix signed/unsigned comparison warning Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 170d3f2f 2011-01-11T20:12:53 Added git_prettify_dir_path(). Clean up a provided absolute or relative directory path. This prettification relies on basic operations such as coalescing multiple forward slashes into a single slash, removing '.' and './' current directory segments, and removing parent directory whenever '..' is encountered. If not empty, the returned path ends with a forward slash. For instance, this will turn "d1/s1///s2/..//../s3" into "d1/s3/". This only performs a string based analysis of the path. No checks are done to make sure the path actually makes sense from the file system perspective.
Alex Budovski a17777d1 2011-01-07T11:35:43 Fixed two buffer handling errors in vector.c - remove() would read one-past array bounds. - resize() would fail if the initial size was 1, because it multiplied by 1.75 and truncated the resulting value. The buffer would always remain at size 1, but elements would repeatedly be appended (via insert()) causing a crash.
Vicent Marti 9f54fe48 2010-12-23T00:15:09 Remove git_errno It was not being used by any methods (only by malloc and calloc), and since it needs to be TLS, it cannot be exported on DLLs on Windows. Burn it with fire. The API always returns error codes! Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 638c2ca4 2010-12-18T02:10:25 Rename 'git_person' to 'git_signature' The new signature struct is public, and contains information about the timezone offset. Must be free'd manually by the user. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 5cccfa89 2010-12-12T00:33:57 Merge branch 'timezone-offset' of https://github.com/nulltoken/libgit2 into timezone
Peter Drahos 5b8bb8e7 2010-12-07T00:54:33 Minor modifications for MinGW/Cygwin compatibility.
nulltoken b76d984e 2010-12-11T16:20:57 Added more person parsing tests.
nulltoken 5a386e4d 2010-12-11T15:50:07 Added timezone checks to person parsing tests.
nulltoken 7161beb1 2010-12-11T15:38:22 Fixed too much faked timezone offset. An offset of more than 14 hours makes no sense (cf. http://www.worldtimezone.com/faq.html).
nulltoken 13710f1e 2010-12-10T16:30:06 Added timezone offset parsing and outputting.
Vicent Marti 2cd6d686 2010-12-10T05:53:39 Tests now run with the resources folder as a hardcoded path Each tests expects a "TEST_RESOURCES" define with the full path to the resources folder. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti a44fc1d4 2010-12-06T23:13:00 Fix type-conversion warnings The types in the git_index_entry struct are now system-defaults, and get truncated to uint32_t's when written back on the index. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 44908fe7 2010-12-06T23:03:16 Change the library include file Libgit2 is now officially include as #include "<git2.h>" or indidividual files may be included as #include <git2/index.h> Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti d12299fe 2010-12-03T22:22:10 Change include structure for the project The maze with include dependencies has been fixed. There is now a global include: #include <git.h> The git_odb_backend API has been exposed. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 7d7cd885 2010-12-03T18:01:30 Decouple storage from ODB logic Comes with two default backends: loose object and packfiles. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 654cd5ff 2010-12-02T21:50:28 Fix segfault in t0603 (unitialized pointer) Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 59995558 2010-12-02T21:48:03 Fix segfault handler in Mac OS X Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti eec95235 2010-12-02T04:58:22 Commit parents now use the common 'vector' code No more linked lists, no more O(n) access. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 41109a7e 2010-12-02T04:42:33 Merge branch 'commitparents' of https://github.com/JustinLove/libgit2 into JustinLove-commitparents
Vicent Marti c4034e63 2010-12-02T04:31:54 Refactor all 'vector' functions into common code All the operations on the 'git_index_entry' array and the 'git_tree_entry' array have been refactored into common code in the src/vector.c file. The new vector methods support: - insertion: O(1) (avg) - deletion: O(n) - searching: O(logn) - sorting: O(logn) - r. access: O(1) Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 1e35f929 2010-12-02T04:19:14 Add stack trace to the tests when building with GCC Signed-off-by: Vicent Marti <tanoku@gmail.com>
Justin Love eb095435 2010-11-30T21:28:39 add git_commit_parent to retrieve a parent by index
Justin Love 12114415 2010-11-30T21:01:47 add git_commit_parentcount
Vicent Marti 277e45f4 2010-11-23T22:36:31 Remove the Makefile from the tests/ folder too Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 6b1eab39 2010-11-23T14:36:31 Fix MSVC warnings and errors Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti d7c7cab8 2010-11-16T03:25:26 Fix memory leak in t0401 Commit object must be internally free'd after each parse attempt, even it fails. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti c3a20d5c 2010-11-14T22:11:46 Add support for 'index add' Actually add files to the index by creating their corresponding blob and storing it on the repository, then getting the hash and updating the index file. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Colin Timmermans 1081d909 2010-11-05T18:04:46 Fix parsing of commits that have no newlines in the message.
Dave Borowitz 88d035bd 2010-11-04T15:08:01 Update commit_time along with committer.
Dave Borowitz f24fa088 2010-11-04T15:06:56 Test that commit attributes are set correctly.
Vicent Marti a8bfce69 2010-11-05T03:50:24 Add string descriptions for all error codes Old descriptions have been updated and new ones have been added for the 'git_strerror' function. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 1795f879 2010-11-05T03:20:17 Improve error handling All initialization functions now return error codes instead of pointers. Error codes are now properly propagated on most functions. Several new and more specific error codes have been added in common.h Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 6fd195d7 2010-11-02T18:42:42 Change git_repository initialization to use a path The constructor to git_repository is now called 'git_repository_open(path)' and takes a path to a git repository instead of an existing ODB object. Unit tests have been updated accordingly and the two test repositories have been merged into one. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti aaf68dc4 2010-10-29T00:47:53 Add unit tests for git_odb_read_header Test the new method by loading all the objects in the sample ODB with a full-read and a header-only read, and comparing the types and sizes. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 58519018 2010-10-28T02:07:18 Fix internal memory management on the library String mememory is now managed in a much more sane manner. Fixes include: - git_person email and name is no longer limited to 64 characters - git_tree_entry filename is no longer limited to 255 characters - raw objects are properly opened & closed the minimum amount of times required for parsing - unit tests no longer leak - removed 5 other misc memory leaks as reported by Valgrind - tree writeback no longer segfaults on rare ocassions The git_person struct is no longer public. It is now managed by the library, and getter methods are in place to access its internal attributes. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Ramsay Jones 2d16373c 2010-10-12T19:12:50 msvc: Fix an "conversion, possible loss of data" warning In particular, msvc complains thus: t0603-sort.c(23) : warning C4244: 'function' : conversion from \ 'time_t' to 'unsigned int', possible loss of data Note that msvc, by default, defines time_t as a 64-bit type, whereas srand() is expecting an (32-bit) unsigned int. In order to suppress the warning, we simply cast the return value of the time() function call to 'unsigned int'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Vicent Marti e4def81a 2010-10-08T13:52:17 Fix issue 3 (memory corruption resize_tree_array) The tree array wasn't being initialized when instantiating a tree object in memory instead of loading it from disk. New unit tests added to check for the problem. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 0ba7a031 2010-10-07T00:42:55 Add unit tests for object write-back Basic write-back & in-memory editing for objects is now tested in t0403 (commits), t0802 (tags) and t0902 (trees). Add new helper functions in test_helpers.c to remove the loose objects created when doing write-back tests. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti c4b5bedc 2010-10-07T00:07:32 Fix possible segfaults in src/tree.c (issue 1) git_tree_entry_byname was dereferencing a NULL pointer when the searched file couldn't be found on the tree. New test cases have been added to check for entry access methods. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 2a884588 2010-09-21T17:17:10 Add write-back support for git_tree All the setter methods for git_tree have been added, including the setters for attributes on each git_tree_entry and methods to add/remove entries of the tree. Modified trees and trees created in-memory from scratch can be written back to the repository using git_object_write(). Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 0c3596f1 2010-09-20T01:57:53 Add setter methods & write support for git_commit All the required git_commit_set_XXX methods have been implemented; all the attributes of a commit object can now be modified in-memory. The new method git_object_write() automatically writes back the in-memory changes of any object to the repository. So far it only supports git_commit objects. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti f49a2e49 2010-09-19T03:21:06 Give object structures more descriptive names The 'git_obj' structure is now called 'git_rawobj', since it represents a raw object read from the ODB. The 'git_repository_object' structure is now called 'git_object', since it's the base object class for all objects. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 003c2690 2010-08-12T18:45:31 Finish the tree object API The interface for loading and parsing tree objects from a repository has been completed with all the required accesor methods for attributes, support for manipulating individual tree entries and a new unit test t0901-readtree which tries to load and parse a tree object from a repository. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti ff17642d 2010-07-19T15:35:52 Add unit tests for index manipulation Three new unit tests, t06XX files have been added. t0601-read: tests for loading index files from disk, for creating in-memory indexes and for accessing index entries. t0602-write: tests for writing index files back to disk t0603-sort: tests for properly sorting the entries array of an index Two test indexes have been added in 'tests/resources/': test/resources/index: a sample index from a libgit2 repository test/resources/gitgit.index: a sample index from a git.git repository (includes TREE extension data) Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 1baa25ee 2010-07-20T23:56:18 Move test resources to a common directory All the external resources used by the tests are now placed inside the common 'tests/resources' directory. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 3315782c 2010-08-08T14:12:17 Redesigned the walking/object lookup interface The old 'git_revpool' object has been removed and split into two distinct objects with separate functionality, in order to have separate methods for object management and object walking. * A new object 'git_repository' does the high-level management of a repository's objects (commits, trees, tags, etc) on top of a 'git_odb'. Eventually, it will also manage other repository attributes (e.g. tag resolution, references, etc). See: src/git/repository.h * A new external method 'git_repository_lookup(repo, oid, type)' has been added to the 'git_repository' API. All object lookups (git_XXX_lookup()) are now wrappers to this method, and duplicated code has been removed. The method does automatic type checking and returns a generic 'git_revpool_object' that can be cast to any specific object. See: src/git/repository.h * The external methods for object parsing of repository objects (git_XXX_parse()) have been removed. Loading objects from the repository is now managed through the 'lookup' functions. These objects are loaded with minimal information, and the relevant parsing is done automatically when the user requests any of the parsed attributes through accessor methods. An attribute has been added to 'git_repository' in order to force the parsing of all the repository objects immediately after lookup. See: src/git/commit.h See: src/git/tag.h See: src/git/tree.h * The previous walking functionality of the revpool is now found in 'git_revwalk', which does the actual revision walking on a repository; the attributes when walking through commits in a database have been decoupled from the actual commit objects. This increases performance when accessing commits during the walk and allows to have several 'git_revwalk' instances working at the same time on top of the same repository, without having to load commits in memory several times. See: src/git/revwalk.h * The old 'git_revpool_table' has been renamed to 'git_hashtable' and now works as a generic hashtable with support for any kind of object and custom hash functions. See: src/hashtable.h * All the relevant unit tests have been updated, renamed and grouped accordingly. Signed-off-by: Vicent Marti <tanoku@gmail.com>