summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix the threading implementationthreadsafeVicent Marti2011-03-175-60/+63
|
* Thread safe cacheVicent Marti2011-03-174-3/+245
|
* Fix headers for the new Revision WalkerVicent Marti2011-03-165-15/+2
| | | | | | The "oid.h" header is now included instead of "object.h". The old "revwalk.h" header has been removed; it was empty.
* Refs are now always in-sync on diskVicent Marti2011-03-162-56/+131
|
* Change the Revwalk reset behavior to the old versionVicent Marti2011-03-163-94/+94
| | | | | The `reset` call now removes the pushed commits so we can reuse the revwalker. The API documentation has been updated with the details.
* Export `git_strarray_free` instead of inliningVicent Marti2011-03-161-0/+9
| | | | That way non-C bindings can use it.
* Properly free commit a commit list in revwalkVicent Marti2011-03-161-4/+8
| | | | | The commit list was not being properly free'd when a walk was stopped halfway through.
* Add proper threading support to libgit2Vicent Marti2011-03-154-104/+209
| | | | | | | 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-1/+2
|
* Debug assertion when using an initialized hashtableVicent Marti2011-03-151-0/+6
|
* Remove duplicate refs in `git_reference_listall`Vicent Marti2011-03-151-11/+18
|
* git_object_lookup() should also check the type if the object comes from the ↵Ben Noordhuis2011-03-151-0/+3
| | | | cache
* Skip the optional header in packed-refs filesVicent Marti2011-03-151-16/+10
|
* Fix the retarded object interdependency systemVicent Marti2011-03-149-235/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+82
| | | | | | | Lists all the references in a repository. Listing may be filtered by reference type. This should applease Lord Clem.
* Rewrite the Pack backendVicent Marti2011-03-142-858/+1058
| | | | | | | | | | The new pack backend is an adaptation of the original git.git code in `sha1_file.c`. It's slightly faster than the previous version and severely less memory-hungry. The call-stack of a normal pack backend query has been properly documented in the top of the header for future reference. And by properly I mean with ASCII diagrams 'n shit.
* Rewrite the Revision WalkerVicent Marti2011-03-146-312/+611
| | | | | | | | | | | | | | | | | | | | | 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/+178
| | | | | | | | | 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>
* Fix creation of deeply-rooted referencesVicent Marti2011-03-054-19/+41
| | | | | | | Use a new `gitfo_creat_force` that will create the full path to a file before creating it. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Use memmove() in git__dirname and git__basenameVicent Marti2011-03-051-2/+2
| | | | | | | We cannot make sure that the user doesn't use the same buffer as source and destination, so write to it using memmove. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Use memmove() in git__joinpath for overlapping copiesVicent Marti2011-03-051-1/+1
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Change interface for Tree Index attr (always unsigned)Vicent Marti2011-03-051-1/+1
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Check for valid range of attributes for tree entrySakari Jokinen2011-03-051-4/+18
|
* Change the return type of `git_blob_rawcontent`Vicent Marti2011-03-051-1/+1
| | | | | | Should return `void *` for raw bytes. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix the opening of empty repositoriesVicent Marti2011-03-051-51/+71
| | | | | | | We were checking for the index file, which is not assured to exist on clean git repositories. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix segmentation fault when freeing a repositoryVicent Marti2011-03-057-37/+43
| | | | | | | | Disable garbage collection of cross-references to prevent double-freeing. Internal reference management is now done with a separate method. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix 'possibly uninitialized variable' warningVicent Marti2011-03-041-1/+1
|
* Don't use non-int bit fieldsVicent Marti2011-03-041-1/+1
| | | | | | They are not standard. MSVC complains about them. And that's not good. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix compilation in MSVCVicent Marti2011-03-031-1/+1
| | | | | | MSVC cannot substract void pointers. Go figure. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Move the external includes folder from `src` to `include`Vicent Marti2011-03-0319-2658/+0
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix several issues with refcountingVicent Marti2011-03-035-33/+86
| | | | | | | - Added several missing reference increases - Add new destructor to the repository that does not GC the objects Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Do not free the index if it's owned by a repositoryVicent Marti2011-03-031-1/+1
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Implement reference counting for git_objectsVicent Marti2011-03-0311-51/+128
| | | | | | | | 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-038-42/+67
| | | | | | | | | | | | | | | | | | 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-0313-198/+195
| | | | | | | | | | | | | | | | | | 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>
* Fix reference removal: remove packed refs together with loose onesnulltoken2011-03-031-2/+16
|
* Fix corner case in reference renamingnulltoken2011-03-031-0/+9
| | | | | Renaming a packed reference should not pack another reference which happens to be in both loose and pack state.
* Add new move function, `gitfo_mv_force`Vicent Marti2011-03-035-6/+35
| | | | | | | Forces a move by creating the folder for the destination file, if it doesn't exist. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix refs renaming to prevent renaming with an invalid namenulltoken2011-03-031-1/+6
|
* Fix reference renaming to prevent duplicated namesnulltoken2011-03-031-0/+10
|
* Fix reference renaming implementation to match standard git behaviornulltoken2011-03-031-14/+51
|
* Slightly changed the behavior of git__joinpath() and git__joinpath_n().nulltoken2011-03-031-1/+5
|
* Prevent _dirent_loose_load() from choking on empty foldersnulltoken2011-03-031-1/+1
|
* Refactored the opening and the initialization of a repository.nulltoken2011-03-033-121/+87
|
* Finish the References APIVicent Marti2011-03-033-221/+786
| | | | | | | | | | | | | | 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>
* Make some Object methods take a const parameterVicent Marti2011-03-032-6/+6
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Add extra methods to the new Hashtable implementationVicent Marti2011-03-032-2/+26
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Move the path comparison method to fileops.cVicent Marti2011-03-033-19/+24
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix warnings in vector.cVicent Marti2011-03-031-3/+1
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Split packed from unpacked referencesVicent Marti2011-03-038-144/+162
| | | | | | | | 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>