summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add test exercising the opening of an standard repository initialized by gitnulltoken2011-03-231-0/+19
|
* Add test exercising the opening of an empty bare repository initialized by gitnulltoken2011-03-231-0/+16
|
* Add remove_placeholders() test helper function which recursively removes ↵nulltoken2011-03-232-0/+29
| | | | marker files from a directory structure
* Add empty bare and normal repos to test resourcesVicent Marti2011-03-2316-0/+31
| | | | We have removed the hooks folder because it takes a lot of space
* Slightly enforce copy_recurs() behaviornulltoken2011-03-232-8/+2
| | | | The folder creation is now decorrelated from the recursive parsing of the source tree structure.
* Improve test coverage of new path prettifying behaviornulltoken2011-03-231-1/+34
|
* Fix detection of attempt to escape the root directory on Windowsnulltoken2011-03-231-0/+32
|
* Change gitfo_prettify_dir_path() and gitfo_prettify_file_path() behaviornulltoken2011-03-232-167/+180
| | | | Those functions now return prettified rooted path.
* Add failing test for issue 84nulltoken2011-03-231-0/+22
| | | | see https://github.com/libgit2/libgit2/issues#issue/84
* Switch from time_t to git_time_tnulltoken2011-03-232-2/+2
| | | | git_time_t is defined as a signed 64 integer. This allows a true predictable multiplatform behavior.
* Fix MSVC warningsVicent Marti2011-03-211-7/+0
|
* I broke your bindingsVicent Marti2011-03-208-222/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hey. Apologies in advance -- I broke your bindings. This is a major commit that includes a long-overdue redesign of the whole object-database structure. This is expected to be the last major external API redesign of the library until the first non-alpha release. Please get your bindings up to date with these changes. They will be included in the next minor release. Sorry again! Major features include: - Real caching and refcounting on parsed objects - Real caching and refcounting on objects read from the ODB - Streaming writes & reads from the ODB - Single-method writes for all object types - The external API is now partially thread-safe The speed increases are significant in all aspects, specially when reading an object several times from the ODB (revwalking) and when writing big objects to the ODB. Here's a full changelog for the external API: blob.h ------ - Remove `git_blob_new` - Remove `git_blob_set_rawcontent` - Remove `git_blob_set_rawcontent_fromfile` - Rename `git_blob_writefile` -> `git_blob_create_fromfile` - Change `git_blob_create_fromfile`: The `path` argument is now relative to the repository's working dir - Add `git_blob_create_frombuffer` commit.h -------- - Remove `git_commit_new` - Remove `git_commit_add_parent` - Remove `git_commit_set_message` - Remove `git_commit_set_committer` - Remove `git_commit_set_author` - Remove `git_commit_set_tree` - Add `git_commit_create` - Add `git_commit_create_v` - Add `git_commit_create_o` - Add `git_commit_create_ov` tag.h ----- - Remove `git_tag_new` - Remove `git_tag_set_target` - Remove `git_tag_set_name` - Remove `git_tag_set_tagger` - Remove `git_tag_set_message` - Add `git_tag_create` - Add `git_tag_create_o` tree.h ------ - Change `git_tree_entry_2object`: New signature is `(git_object **object_out, git_repository *repo, git_tree_entry *entry)` - Remove `git_tree_new` - Remove `git_tree_add_entry` - Remove `git_tree_remove_entry_byindex` - Remove `git_tree_remove_entry_byname` - Remove `git_tree_clearentries` - Remove `git_tree_entry_set_id` - Remove `git_tree_entry_set_name` - Remove `git_tree_entry_set_attributes` object.h ------------ - Remove `git_object_new - Remove `git_object_write` - Change `git_object_close`: This method is now *mandatory*. Not closing an object causes a memory leak. odb.h ----- - Remove type `git_rawobj` - Remove `git_rawobj_close` - Rename `git_rawobj_hash` -> `git_odb_hash` - Change `git_odb_hash`: New signature is `(git_oid *id, const void *data, size_t len, git_otype type)` - Add type `git_odb_object` - Add `git_odb_object_close` - Change `git_odb_read`: New signature is `(git_odb_object **out, git_odb *db, const git_oid *id)` - Change `git_odb_read_header`: New signature is `(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id)` - Remove `git_odb_write` - Add `git_odb_open_wstream` - Add `git_odb_open_rstream` odb_backend.h ------------- - Change type `git_odb_backend`: New internal signatures are as follows int (* read)(void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *) int (* read_header)(size_t *, git_otype *, struct git_odb_backend *, const git_oid *) int (* writestream)(struct git_odb_stream **, struct git_odb_backend *, size_t, git_otype) int (* readstream)( struct git_odb_stream **, struct git_odb_backend *, const git_oid *) - Add type `git_odb_stream` - Add enum `git_odb_streammode` Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Thread safe cacheVicent Marti2011-03-203-7/+63
|
* Fix headers for the new Revision WalkerVicent Marti2011-03-161-2/+0
| | | | | | The "oid.h" header is now included instead of "object.h". The old "revwalk.h" header has been removed; it was empty.
* Change the Revwalk reset behavior to the old versionVicent Marti2011-03-161-11/+6
| | | | | The `reset` call now removes the pushed commits so we can reuse the revwalker. The API documentation has been updated with the details.
* Add proper threading support to libgit2Vicent Marti2011-03-151-13/+0
| | | | | | | We now depend on libpthread on all Unix platforms (should be installed by default) and use a simple wrapper for Windows threads under Win32. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Do not segfault when listing unpacked referencesVicent Marti2011-03-151-0/+19
|
* Remove duplicate refs in `git_reference_listall`Vicent Marti2011-03-151-1/+5
|
* Add test case for issue GH-86Ben Noordhuis2011-03-151-0/+4
|
* Fix the retarded object interdependency systemVicent Marti2011-03-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's no longer retarded. All object interdependencies are stored as OIDs instead of actual objects. This should be hundreds of times faster, specially on big repositories. Heck, who knows, maye it doesn't even segfault -- wouldn't that be awesome? What has changed on the API? `git_commit_parent`, `git_commit_tree`, `git_tag_target` now return their values through a pointer-to-pointer, and have an error code. `git_commit_set_tree` and `git_tag_set_target` now return an error code and may fail. `git_repository_free__no_gc` has been deprecated because it's stupid. Since there are no longer any interdependencies between objects, we don't need internal reference counting, and GC never fails or double-free's pointers. `git_object_close` now does a very sane thing: marks an object as unused. Closed objects will be eventually free'd from the object cache based on LRU. Please use `git_object_close` from the garbage collector `destroy` method on your bindings. It's 100% safe. `git_repository_gc` is a new method that forces a garbage collector pass through the repo, to free as many LRU objects as possible. This is useful if we are running out of memory.
* Add new method `git_reference_listall`Vicent Marti2011-03-141-0/+13
| | | | | | | Lists all the references in a repository. Listing may be filtered by reference type. This should applease Lord Clem.
* Rewrite the Revision WalkerVicent Marti2011-03-141-89/+20
| | | | | | | | | | | | | | | | | | | | | The new revision walker uses an internal Commit object storage system, custom memory allocator and much improved topological and time sorting algorithms. It's about 20x times faster than the previous implementation when browsing big repositories. The following external API calls have changed: `git_revwalk_next` returns an OID instead of a full commit object. The initial call to `git_revwalk_next` is no longer blocking when iterating through a repo with a time-sorting mode. Iterating with Topological or inverted modes still makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo). `git_revwalk_push` and `git_revwalk_hide` now take an OID instead of a full commit object.
* Add `git_oid_shorten` (unique OID minimzer)Vicent Marti2011-03-141-0/+92
| | | | | | | | | Set of methods to find the minimal-length to uniquely identify every OID in a list. Useful for GUI applications, commit logs and so on. Includes stress test. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* clean up temp repo for t12-repo testsTim Clem2011-03-042-9/+18
| | | | | add actual must_pass calls back into the repo tests and remove ./ from beginning of temp repo path
* Implement reference counting for git_objectsVicent Marti2011-03-031-3/+0
| | | | | | | | 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>
* Fix searching in git_vectorVicent Marti2011-03-032-6/+6
| | | | | | | | | | | | | | | | | | 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>
* Change the object creation/lookup APIVicent Marti2011-03-031-38/+38
| | | | | | | | | | | | | | | | | | 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>
* Cleanup the testing toolkitVicent Marti2011-03-0319-690/+622
| | | | | | | | | | | | | | | | | | | 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>
* Add test ↵nulltoken2011-03-031-0/+36
| | | | deleteref::deleting_a_ref_which_is_both_packed_and_loose_should_remove_both_tracks_in_the_filesystem()
* Add test for corner case in reference renamingnulltoken2011-03-031-0/+45
|
* Add test renameref::rename_a_loose_reference()nulltoken2011-03-031-0/+46
|
* Add test renameref::can_not_rename_a_reference_with_an_invalid_name()nulltoken2011-03-031-0/+23
|
* Add test renameref::can_not_rename_a_reference_with_an_invalid_name()nulltoken2011-03-031-0/+20
|
* Add test renameref::renaming_a_packed_reference_makes_it_loose()nulltoken2011-03-031-1/+46
|
* Slightly changed the behavior of git__joinpath() and git__joinpath_n().nulltoken2011-03-031-2/+21
|
* Enhance the packrefs::create_packfile() testnulltoken2011-03-031-5/+47
|
* Added copydir_recurs() to test_helpers.cnulltoken2011-03-033-7/+61
| | | | | | 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.
* Refactored some test related constants.nulltoken2011-03-032-13/+15
|
* Added tests to exercise the initialization and the opening of a repository.nulltoken2011-03-031-0/+47
|
* Removed a duplicate constant.nulltoken2011-03-031-5/+4
|
* Added rmdir_recurs(), a test helper function which recursively removes the ↵nulltoken2011-03-032-0/+27
| | | | content of a directory.
* Added some dirname and basename tests to ensure that trailing slashes are ↵nulltoken2011-03-031-0/+5
| | | | ignored.
* Finish the References APIVicent Marti2011-03-031-0/+8
| | | | | | | | | | | | | | 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>
* Slightly enhanced the readability of some reference related tests.nulltoken2011-03-031-91/+95
|
* Removed duplicate tests.nulltoken2011-03-031-8/+1
|
* Split packed from unpacked referencesVicent Marti2011-03-031-113/+112
| | | | | | | | 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>
* Added test covering creation of nested symbolic references.nulltoken2011-03-031-0/+24
|
* Refactored the reference creation API.nulltoken2011-03-031-8/+2
|
* Added some more tests to ensure the correct behavior of ↵nulltoken2011-03-031-1/+127
| | | | git_reference__normalize_name().
* Fixed line endings (CRLF->LF).nulltoken2011-03-031-26/+26
|