1. 06 Nov, 2010 3 commits
  2. 05 Nov, 2010 4 commits
  3. 03 Nov, 2010 1 commit
  4. 02 Nov, 2010 2 commits
  5. 31 Oct, 2010 1 commit
    • Fix in-memory commit getters trying to parse · d80e9d55
      Issue 9 on the tracker. The commit object getters for in-memory objects
      were trying to parse an inexistant on-disk object when one of the commit
      attributes which were still not set was queried.
      
      We now return a NULL value when this happens.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  6. 28 Oct, 2010 4 commits
  7. 27 Oct, 2010 1 commit
    • Fix internal memory management on the library · 58519018
      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>
      Vicent Marti committed
  8. 26 Oct, 2010 3 commits
  9. 25 Oct, 2010 2 commits
  10. 08 Oct, 2010 1 commit
  11. 06 Oct, 2010 3 commits
  12. 21 Sep, 2010 1 commit
    • Add write-back support for git_tree · 2a884588
      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 committed
  13. 20 Sep, 2010 1 commit
    • Add support for in-memory objects · d45b4a9a
      All repository objects can now be created from scratch in memory using
      either the git_object_new() method, or the corresponding git_XXX_new()
      for each object.
      
      So far, only git_commits can be written back to disk once created in
      memory.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  14. 19 Sep, 2010 3 commits
    • Add setter methods & write support for git_commit · 0c3596f1
      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 committed
    • Implement internal methods to write on sources · e802d8cc
      The new 'git__source_printf' does an overflow-safe printf on a source
      bfufer.
      
      The new 'git__source_write' does an overflow-safe byte write on a source
      buffer.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Give object structures more descriptive names · f49a2e49
      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 committed
  15. 18 Sep, 2010 1 commit
    • Add generic methods for object writeback · a7a7ddbe
      git_repository_object has now several internal methods to write back the
      object information in the repository.
      
      - git_repository__dbo_prepare_write()
      	Prepares the DBO object to be modified
      
      - git_repository__dbo_write()
      	Writes new bytes to the DBO object
      
      - git_repository__dbo_writeback()
      	Writes back the changes to the repository
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  16. 12 Sep, 2010 1 commit
  17. 08 Sep, 2010 1 commit
  18. 12 Aug, 2010 7 commits
    • Add support for manually freeing repo objects · 9c9f4fc1
      A new method 'git_repository_object_free' allows to manually force the
      freeing of a repository object, even though they are still automatically
      managed by the repository and don't need to be freed by the user.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Fix object handling in git_repository · f2408cc2
      All loaded objects through git_repository_lookup are properly parsed &
      free'd on failure.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Add auxiliary method git__hexdump · 0e465f97
      New function in util.c to do a dump of a buffer's contents in
      hexadecimal to stdout.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Finish the tree object API · 003c2690
      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 committed
    • Add unit tests for index manipulation · ff17642d
      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 committed
    • Move test resources to a common directory · 1baa25ee
      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 committed
    • Add support for git index files · 68535125
      The new 'git_index' structure is an in-memory representation
      of a git index on disk; the 'git_index_entry' structures represent
      each one of the file entries on the index.
      
      The following calls for index instantiation have been added:
      
      	git_index_alloc(): instantiate a new index structure
      	git_index_free(): free an existing index
      	git_index_clear(): clear all the entires in an existing file
      
      The following calls for index reading and writing have been added:
      
      	git_index_read(): update the contents of the index structure from
      					  its file on disk.
      
      		Internally implemented through:
      			git_index__parse()
      
      	Index files are stored on disk in network byte order; all integer fields
      	inside them are properly converted to the machine's byte order when
      	loading them in memory. The parsing engine also distinguishes
      	between normal index entries and extended entries with 2 extra bytes
      	of flags.
      
      	The 'TREE' extension for index entries is also loaded into memory:
      	Tree caches stored in Index files are loaded into the
      	'git_index_tree' structure pointed by the 'tree' pointer inside
      	'git_index'.
      
      	'index->tree' points to the root node of the tree cache; the full tree
      	can be traversed through each of the node's 'tree->children'.
      
      	Index files can be written back to disk through:
      
      	git_index_write(): atomic writing of existing index objects
      		backed by internal method git_index__write()
      
      The following calls for entry manipulation have been added:
      
      	git_index_add(): insert an empty entry to the index
      
      	git_index_find(): search an entry by its path name
      
      	git_index__append(): appends a new index entry to the end of the
      						 list, resizing the entries array if required
      
      	New index entries are always inserted at the end of the array; since the
      	index entries must be sorted for it to be internally consistent, the
      	index object is only sorted once, and if required, before accessing the
      	whole entriea array (e.g. before writing to disk, before traversing,
      	etc).
      
      	git_index__remove_pos(): remove an index entry in a specific position
      
      	git_index__sort(): sort the entries in the array by path name
      
      	The entries array is sorted stably and in place using an
      	insertion sort, which ought to be the most efficient approach
      	since the entries array is always mostly-sorted.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed