summaryrefslogtreecommitdiff
path: root/src/git2
Commit message (Collapse)AuthorAgeFilesLines
* Move the external includes folder from `src` to `include`Vicent Marti2011-03-0318-2602/+0
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix several issues with refcountingVicent Marti2011-03-031-0/+3
| | | | | | | - 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>
* Implement reference counting for git_objectsVicent Marti2011-03-031-8/+17
| | | | | | | | 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>
* Change the object creation/lookup APIVicent Marti2011-03-037-71/+68
| | | | | | | | | | | | | | | | | | 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>
* Finish the References APIVicent Marti2011-03-031-0/+18
| | | | | | | | | | | | | | 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-031-3/+3
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Split packed from unpacked referencesVicent Marti2011-03-031-2/+3
| | | | | | | | 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>
* Brush up the refs APIVicent Marti2011-03-031-27/+39
| | | | | | | | Changed some more API details and updated documentation. Sketched API for addition/removal of entries. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Refactored the reference creation API.nulltoken2011-03-031-21/+25
|
* Added GIT_EINVALIDREFSTATE error.nulltoken2011-03-031-0/+3
|
* Added git_reference__normalize_name() along with tests.nulltoken2011-03-031-0/+1
|
* Add missing include to odb_backends.hVicent Marti2011-03-011-0/+1
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* include "oid.h" in headers that use git_oidSakari Jokinen2011-02-252-0/+2
| | | | This makes generating bindings to hlibgit2 easier
* fix cast in tag.hTim Clem2011-02-141-2/+2
| | | | | git_tag_lookup() and git_tag_new() changed to cast GIT_OBJ_TAG to git_otype in order to compile lib in xcode
* Internal changes on the backend systemVicent Marti2011-02-092-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Git trees are now always lazily sortedVicent Marti2011-02-071-30/+0
| | | | | | | | | | | Removed `git_tree_add_entry_unsorted`. Now the `git_tree_add_entry` method doesn't sort the entries array by default; entries are only sorted lazily when required. This is done automatically by the library (the `git_tree_sort_entries` call has been removed). This should improve performance. No point on sorting entries all the time, anyway. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Add support for SQLite backendsVicent Marti2011-02-051-0/+7
| | | | | | | | | | | | 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>
* Make more methods return error codesVicent Marti2011-02-053-5/+14
| | | | | | | | 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>
* Merge branch 'master' of https://github.com/jwiegley/libgit2Vicent Marti2011-02-051-0/+40
|\
| * Make git_tree_clear_entries visible to the userJohn Wiegley2011-02-011-0/+10
| |
| * Added git_tree_add_entry_unsorted and git_tree_sort_entriesJohn Wiegley2011-02-011-0/+30
| |
* | Add required includes in "oid.h"Vicent Marti2011-02-011-0/+3
|/ | | | The file was previously failing to be included stand-alone.
* Refactor reference parsing codeVicent Marti2011-01-303-10/+179
| | | | | | | | | 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>
* Merge nulltoken's reference parsing codenulltoken2011-01-293-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Made path prettifying functions return GIT_EINVALIDPATH instead of GIT_ERROR.nulltoken2011-01-291-0/+3
|
* Return the created entry in git_tree_add_entry()Vicent Marti2011-01-291-2/+5
| | | | | | | | | | 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>
* Fix compilation on MinGWVicent Marti2011-01-201-0/+2
| | | | | | Require <sys/types.h> to find the definition for off64_t. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Add new Repository initialization methodVicent Marti2011-01-131-0/+36
| | | | | | | Lets the user specify the ODB that will be used by the repository manually. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix typo on Commit APIVicent Marti2011-01-131-1/+1
| | | | | | Proper function is 'git_commit_time_offset'. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Move the compat definitions to types.hVicent Marti2011-01-122-71/+39
| | | | | | | | | Don't need a brand new header for two typedefs when we already have a types.h header. Change comment style to ANSI C. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Revised platform types to use 'best supported' size.Alex Budovski2011-01-112-2/+73
| | | | | This will allow graceful migration to 64 bit file sizes and timestamps should git's binary interface be extended to allow this.
* Use generic types in git_index_entryVicent Marti2011-01-101-3/+3
| | | | | | | Off_t is not cool. It can be 32 or 64 bits depending on the platform, but on the Index format, it's always 32 bits. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Split object methods from repository.cVicent Marti2011-01-035-8/+50
| | | | | | All the relevant git_object methods have been moved to object.c Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Remove git_errnoVicent Marti2010-12-231-10/+0
| | | | | | | | | 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>
* Export TLS symbols properly in Win32Vicent Marti2010-12-221-0/+2
| | | | | | There was no export definition for GIT_EXTERN_TLS() under MSVC. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix issues in repository initializationVicent Marti2010-12-191-8/+9
| | | | | | | Implemented recursive directory creation Fix style issues Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Merge branch 'repo-init' of https://github.com/nulltoken/libgit2 into ↵Vicent Marti2010-12-191-2/+18
|\ | | | | | | nulltoken-repo-init
| * Added a comment reminding that the gitfo_mkdir_recurs() is far from being ↵nulltoken2010-12-171-1/+1
| | | | | | | | fully implemented.
| * Added basic HEAD file creation.nulltoken2010-12-171-3/+16
| |
| * Very first git_repository_init() draft.nulltoken2010-12-151-0/+3
| |
* | Rename 'git_person' to 'git_signature'Vicent Marti2010-12-185-28/+92
| | | | | | | | | | | | | | 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>
* | Added timezone offset parsing and outputting.nulltoken2010-12-103-3/+14
|/
* Fix type-conversion warningsVicent Marti2010-12-061-3/+3
| | | | | | | 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>
* Add license file to all public headersVicent Marti2010-12-0616-15/+406
| | | | | | Yes, the public headers do need our license. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Change the library include fileVicent Marti2010-12-0616-0/+1694
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>