]> git.proxmox.com Git - libgit2.git/log
libgit2.git
13 years agotag: discover the target type if needed
Carlos Martín Nieto [Tue, 5 Apr 2011 14:53:32 +0000 (16:53 +0200)]
tag: discover the target type if needed

Don't blindly pass the target type to git_tag_type2string as it will
give an empty string on GIT_OBJ_ANY which would cause us to create an
invalid tag object.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoindex.h: Add IDXENTRY flags needed for index operations
Jakob Pfender [Mon, 4 Apr 2011 14:20:09 +0000 (16:20 +0200)]
index.h: Add IDXENTRY flags needed for index operations

Add several IDXENTRY flags that need to be checked in
order to properly implement update-index --refresh.

13 years agoAdded git_commit_tree_oid and git_commit_parent_oid.
Sam [Wed, 6 Apr 2011 00:48:31 +0000 (10:48 +1000)]
Added git_commit_tree_oid and git_commit_parent_oid.

13 years agofix git_treebuilder_insert probrem.
Shuhei Tanuma [Tue, 5 Apr 2011 17:22:24 +0000 (02:22 +0900)]
fix git_treebuilder_insert probrem.

couldn't add new entry when inserting new one with `git_treebuilder_insert`.

13 years agoDo not assert error codes on Hiredis backend
Vicent Marti [Fri, 8 Apr 2011 00:28:38 +0000 (03:28 +0300)]
Do not assert error codes on Hiredis backend

We cannot assume that Redis is never going to return an error code; when
Reddit fails, we cannot crash our library, we need to handle the crash
gracefully.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
13 years agoredis backend
Dmitry Kovega [Sun, 3 Apr 2011 17:43:51 +0000 (21:43 +0400)]
redis backend

13 years agoBuild & write custom trees in memory
Vicent Marti [Mon, 4 Apr 2011 16:24:19 +0000 (19:24 +0300)]
Build & write custom trees in memory

13 years agoMake reinitializing a repository return GIT_ENOTIMPLEMENTED instead of GIT_SUCCESS
nulltoken [Sun, 3 Apr 2011 16:31:45 +0000 (18:31 +0200)]
Make reinitializing a repository return GIT_ENOTIMPLEMENTED instead of GIT_SUCCESS

13 years agoFix tag reference name in testrepo.git
nulltoken [Sun, 3 Apr 2011 11:50:09 +0000 (13:50 +0200)]
Fix tag reference name in testrepo.git

The git test repository was holding a wrongly named tag reference ("very-simple") pointing at a tag named "e90810b".
This mistake (mine :-/ ) originates back to https://github.com/libgit2/libgit2/commit/9282e92

Whole credit goes to @tclem for having spotted this.

13 years agoAdd a fake wstream to the ODB
Vicent Marti [Mon, 4 Apr 2011 10:05:20 +0000 (13:05 +0300)]
Add a fake wstream to the ODB

Streaming writes will no longer fail when writing to a backend that
doesn't support streaming writes but supports direct ones.
Now we create a fake stream on memory and then write it as a single
block using the backend `write` callback.

13 years agoFix the git_tree_write implementation
Vicent Marti [Mon, 4 Apr 2011 09:14:03 +0000 (12:14 +0300)]
Fix the git_tree_write implementation

13 years agoNew external API method: `git_tree_create`
Sarath Lakshman [Sun, 3 Apr 2011 11:48:56 +0000 (17:18 +0530)]
New external API method: `git_tree_create`

Creates a tree by scanning the index file. The method handles recursive
creation of trees for subdirectories and adds them to the parent tree.

13 years agoMerge branch 'tagging' of https://github.com/nulltoken/libgit2 into development
Vicent Marti [Sat, 2 Apr 2011 09:49:14 +0000 (12:49 +0300)]
Merge branch 'tagging' of https://github.com/nulltoken/libgit2 into development

Conflicts:
include/git2/tag.h
src/tag.c

13 years agoChange `parse` methods to const buffer
Vicent Marti [Sat, 2 Apr 2011 09:42:04 +0000 (12:42 +0300)]
Change `parse` methods to const buffer

Signed-off-by: Vicent Marti <tanoku@gmail.com>
13 years agoMerge branch 'parse-tag-buffer' of https://github.com/carlosmn/libgit2 into development
Vicent Marti [Sat, 2 Apr 2011 09:28:35 +0000 (12:28 +0300)]
Merge branch 'parse-tag-buffer' of https://github.com/carlosmn/libgit2 into development

13 years agoUpdate README after sqlite option change
Olivier Ramonat [Wed, 30 Mar 2011 17:47:12 +0000 (19:47 +0200)]
Update README after sqlite option change

To build libgit2 with sqlite support, waf configure should be run
with --with-sqlite

13 years agowscript: Use -O0 on debug
Carlos Martín Nieto [Thu, 31 Mar 2011 13:02:23 +0000 (15:02 +0200)]
wscript: Use -O0 on debug

If we want debugging symbols, we most likely want them to point to the
right place. With -O2, gdb or valgrind may give wrong information.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoRename git_tag_create_o_f() to git_tag_create_fo()
nulltoken [Wed, 30 Mar 2011 21:46:54 +0000 (23:46 +0200)]
Rename git_tag_create_o_f() to git_tag_create_fo()

13 years agoAdd git_tag_delete()
nulltoken [Wed, 30 Mar 2011 21:26:36 +0000 (23:26 +0200)]
Add git_tag_delete()

13 years agoAdd git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag referenc...
nulltoken [Wed, 30 Mar 2011 21:16:30 +0000 (23:16 +0200)]
Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any

13 years agoFix memory leak in tag releated tests
nulltoken [Wed, 30 Mar 2011 20:46:52 +0000 (22:46 +0200)]
Fix memory leak in tag releated tests

13 years agoPrevent tag_create() from creating a conflicting reference
nulltoken [Wed, 30 Mar 2011 20:30:55 +0000 (22:30 +0200)]
Prevent tag_create() from creating a conflicting reference

13 years agoAdd test demonstrating that one can create a tag pointing at a non existent target
nulltoken [Wed, 30 Mar 2011 19:57:20 +0000 (21:57 +0200)]
Add test demonstrating that one can create a tag pointing at a non existent target

13 years agoEnforce the testing of the correct creation of a tag
nulltoken [Wed, 30 Mar 2011 19:46:19 +0000 (21:46 +0200)]
Enforce the testing of the correct creation of a tag

13 years agoFix misleading comments
nulltoken [Wed, 30 Mar 2011 19:29:10 +0000 (21:29 +0200)]
Fix misleading comments

13 years agoAdd test ensuring one can not create an oid reference which targets at an unknown id
nulltoken [Tue, 29 Mar 2011 19:29:30 +0000 (21:29 +0200)]
Add test ensuring one can not create an oid reference which targets at an unknown id

13 years agoReplace gitfo_unlink() calls with git_reference_delete() in refs related tests
nulltoken [Tue, 29 Mar 2011 19:21:47 +0000 (21:21 +0200)]
Replace gitfo_unlink() calls with git_reference_delete() in refs related tests

13 years agoFix help message for waf configure --with-sqlite
Olivier Ramonat [Tue, 29 Mar 2011 12:19:40 +0000 (14:19 +0200)]
Fix help message for waf configure --with-sqlite

13 years agoCheck for looser reference names
Carlos Martín Nieto [Tue, 29 Mar 2011 09:43:31 +0000 (11:43 +0200)]
Check for looser reference names

res/dummy/a and refs/stash must pass. The other rules are already
tested by the rest of the checks.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agonormalize_name: allow more references under refs/
Carlos Martín Nieto [Thu, 24 Mar 2011 13:15:00 +0000 (14:15 +0100)]
normalize_name: allow more references under refs/

Allow any well-formed reference name to live under refs/ removing the
condition that they be under refs/{heads,tags,remotes}/ as was the
design of git.

An exception is made for HEAD which is allowed to contain an OID
reference in detached HEAD state.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agorefs: Don't allow references to inexistent OIDs
Vicent Marti [Tue, 29 Mar 2011 16:40:02 +0000 (19:40 +0300)]
refs: Don't allow references to inexistent OIDs

13 years agoEnforce coding conventions in refs.c
Vicent Marti [Tue, 29 Mar 2011 16:22:21 +0000 (19:22 +0300)]
Enforce coding conventions in refs.c

Internal methods are static and without the git prefix.
'Force' methods have a `_f` prefix to match the other 'force' methods.

13 years agoMake overwrite test more comprehensive
Carlos Martín Nieto [Tue, 29 Mar 2011 09:30:09 +0000 (11:30 +0200)]
Make overwrite test more comprehensive

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoforce-rename test: check for the right name
Carlos Martín Nieto [Tue, 29 Mar 2011 08:52:29 +0000 (10:52 +0200)]
force-rename test: check for the right name

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agorename: don't return early if the target ref exists
Carlos Martín Nieto [Tue, 29 Mar 2011 08:47:48 +0000 (10:47 +0200)]
rename: don't return early if the target ref exists

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd tests covering overwriting references
Carlos Martín Nieto [Mon, 28 Mar 2011 16:40:58 +0000 (18:40 +0200)]
Add tests covering overwriting references

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix documentation copy error
Carlos Martín Nieto [Mon, 28 Mar 2011 13:05:02 +0000 (15:05 +0200)]
Fix documentation copy error

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMatch the comment with the error string
Carlos Martín Nieto [Mon, 28 Mar 2011 12:53:52 +0000 (14:53 +0200)]
Match the comment with the error string

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAllow forcing the creation or renaming of references
Carlos Martín Nieto [Mon, 28 Mar 2011 10:00:50 +0000 (12:00 +0200)]
Allow forcing the creation or renaming of references

Add internal reference create and rename functions which take a force
parameter, telling them to overwrite an existing reference if it
exists.

These functions try to update the reference if it's of the same type
as the one it's going to be replaced by. Otherwise the old reference
becomes invalid.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd GIT_EEXISTS error code
Carlos Martín Nieto [Mon, 28 Mar 2011 09:31:58 +0000 (11:31 +0200)]
Add GIT_EEXISTS error code

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agolibgit2 version 0.11.0, "McSwifty"
Vicent Marti [Mon, 28 Mar 2011 19:35:27 +0000 (22:35 +0300)]
libgit2 version 0.11.0, "McSwifty"

Apologies for the massive changes in the external API (that's my fault),
and for the terrible codename for this release (that's @tclem's fault).

The detailed overview for the major API changes can be found in the
commit at 72a3fe42fb7208712bbe8f0981f4c6274c05e9c3.

Major new features in this release:

- 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
- Improved reference handling
- New method to list references
- ZLib is now built-in
- Improvements to the Revision Walker
- Tons of bug fixes

Thanks to all the contributors who make this possible.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
13 years agoUpdate the SQLite backend
Vicent Marti [Mon, 28 Mar 2011 19:23:44 +0000 (22:23 +0300)]
Update the SQLite backend

13 years agoindex.c: Fix tiny typos
schu [Mon, 28 Mar 2011 15:59:13 +0000 (17:59 +0200)]
index.c: Fix tiny typos

13 years agosignature.h: Fix tiny typo
schu [Mon, 28 Mar 2011 15:57:08 +0000 (17:57 +0200)]
signature.h: Fix tiny typo

13 years agoAdd git_tag_create_frombuffer API
Carlos Martín Nieto [Mon, 28 Mar 2011 11:59:48 +0000 (13:59 +0200)]
Add git_tag_create_frombuffer API

Expose the tag parsing capabilities already present in the
library.

Exporting this function makes it possible to implement the
mktag command without duplicating this functionality.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix memory leak in parse_tag_buffer
Carlos Martín Nieto [Mon, 28 Mar 2011 11:58:44 +0000 (13:58 +0200)]
Fix memory leak in parse_tag_buffer

Free the allocated memory if the signature parsing reports an error.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoNew external API method: `git_reference_listcb`
Vicent Marti [Fri, 25 Mar 2011 21:53:38 +0000 (23:53 +0200)]
New external API method: `git_reference_listcb`

List all the references in the repository, calling a custom
callback for each one.

The listed references may be filtered by type, or using
a bitwise OR of several types. Use the magic value
`GIT_REF_LISTALL` to obtain all references, including
packed ones.

The `callback` function will be called for each of the references
in the repository, and will receive the name of the reference and
the `payload` value passed to this method.

13 years agoindex.h: Fix minor typo
Jakob Pfender [Thu, 24 Mar 2011 17:28:04 +0000 (18:28 +0100)]
index.h: Fix minor typo

13 years agoindex.h: Correct documentation for git_index_open_inrepo()
Jakob Pfender [Thu, 24 Mar 2011 12:48:22 +0000 (13:48 +0100)]
index.h: Correct documentation for git_index_open_inrepo()

Fix the doxygen comments for git_index_open_inrepo(). Previously they
referred to a param index_path and omitted index (probably a c&p
error).

13 years agoindex.c: Read index after initialization
Jakob Pfender [Thu, 24 Mar 2011 14:32:24 +0000 (15:32 +0100)]
index.c: Read index after initialization

The current behaviour of git_index_open{bare,inrepo}() is unexpected.
When an index is opened, an in-memory index object is created that is
linked to the index discovered by git_repository_open(). However, this
index object is empty, as the on-disk index is not read. To fully open
the on-disk index file, git_index_read() has to be called. This leads to
confusing behaviour. Consider the following code:

git_index *idx;
git_index_open_inrepo(&idx, repo);
git_index_write(idx);

You would expect this to have no effect, as the index is never
ostensibly manipulated. However, what actually happens is that the index
entries are removed from the on-disk index because the empty in-memory
index object created by open_inrepo() is written back to the disk.

This patch reads the index after opening it.

13 years agoadd go-git (Go bindings) to the readme
Scott Chacon [Thu, 24 Mar 2011 00:06:49 +0000 (17:06 -0700)]
add go-git (Go bindings) to the readme

13 years agoRemove circular dependency in includes
Vicent Marti [Wed, 23 Mar 2011 18:18:34 +0000 (20:18 +0200)]
Remove circular dependency in includes

13 years agoodb.h: Fix minor typo
Jakob Pfender [Wed, 23 Mar 2011 13:57:41 +0000 (14:57 +0100)]
odb.h: Fix minor typo

Fix a doxygen typo ("@para" instead of "@param") in odb.h

13 years agocommon.h: Fix minor typos
Jakob Pfender [Wed, 23 Mar 2011 11:35:08 +0000 (12:35 +0100)]
common.h: Fix minor typos

Fix a few minor typos in the documentation of the GIT_ERROR codes.

13 years agoImprove the ODB writing backend
Vicent Marti [Wed, 23 Mar 2011 16:44:53 +0000 (18:44 +0200)]
Improve the ODB writing backend

Temporary files when doing streaming writes are now stored inside the
Objects folder, to prevent issues when moving files between
disks/partitions.

Add support for block writes to the ODB again (for those backends that
cannot implement streaming).

13 years agoAdd Ocaml bindings to the readme
Vicent Marti [Wed, 23 Mar 2011 13:53:12 +0000 (15:53 +0200)]
Add Ocaml bindings to the readme

13 years agoDo not return on `void` helper methods
Vicent Marti [Wed, 23 Mar 2011 13:44:52 +0000 (15:44 +0200)]
Do not return on `void` helper methods

MSVC doesn't swallow that.

13 years agoRemove `git_repository_gc` from the headers
Vicent Marti [Wed, 23 Mar 2011 13:40:47 +0000 (15:40 +0200)]
Remove `git_repository_gc` from the headers

13 years agoAdd close wappers for commit, tree, tag and blob
Carlos Martín Nieto [Tue, 22 Mar 2011 15:15:50 +0000 (16:15 +0100)]
Add close wappers for commit, tree, tag and blob

In the same spirit that git_repository_lookup is no longer available,
add wrappers so the users don't have to cast when closing their
objects.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix compilation in MinGW
Vicent Marti [Tue, 22 Mar 2011 23:58:18 +0000 (01:58 +0200)]
Fix compilation in MinGW

13 years agoAdd test exercising the opening of an standard repository initialized by git
nulltoken [Sat, 5 Mar 2011 14:09:01 +0000 (15:09 +0100)]
Add test exercising the opening of an standard repository initialized by git

13 years agoAdd test exercising the opening of an empty bare repository initialized by git
nulltoken [Sat, 5 Mar 2011 13:33:31 +0000 (14:33 +0100)]
Add test exercising the opening of an empty bare repository initialized by git

13 years agoAdd remove_placeholders() test helper function which recursively removes marker files...
nulltoken [Sat, 5 Mar 2011 13:26:22 +0000 (14:26 +0100)]
Add remove_placeholders() test helper function which recursively removes marker files from a directory structure

13 years agoAdd empty bare and normal repos to test resources
Vicent Marti [Tue, 22 Mar 2011 22:21:30 +0000 (00:21 +0200)]
Add empty bare and normal repos to test resources

We have removed the hooks folder because it takes a lot of space

13 years agoAdd detection of incorrect usage to git__joinpath()
nulltoken [Sat, 19 Mar 2011 07:31:40 +0000 (08:31 +0100)]
Add detection of incorrect usage to git__joinpath()

13 years agoSlightly enforce copy_recurs() behavior
nulltoken [Sat, 19 Mar 2011 07:19:34 +0000 (08:19 +0100)]
Slightly enforce copy_recurs() behavior

The folder creation is now decorrelated from the recursive parsing of the source tree structure.

13 years agoImprove test coverage of new path prettifying behavior
nulltoken [Fri, 18 Mar 2011 21:27:15 +0000 (22:27 +0100)]
Improve test coverage of new path prettifying behavior

13 years agoFix detection of attempt to escape the root directory on Windows
nulltoken [Fri, 18 Mar 2011 18:10:36 +0000 (19:10 +0100)]
Fix detection of attempt to escape the root directory on Windows

13 years agoChange gitfo_prettify_dir_path() and gitfo_prettify_file_path() behavior
nulltoken [Fri, 18 Mar 2011 15:56:43 +0000 (16:56 +0100)]
Change gitfo_prettify_dir_path() and gitfo_prettify_file_path() behavior

Those functions now return prettified rooted path.

13 years agoMake gitfo_prettify_dir_path() and gitfo_prettify_file_path() no longer externalized
nulltoken [Thu, 17 Mar 2011 05:56:58 +0000 (06:56 +0100)]
Make gitfo_prettify_dir_path() and gitfo_prettify_file_path() no longer externalized

13 years agoAdd failing test for issue 84
nulltoken [Tue, 15 Mar 2011 21:07:01 +0000 (22:07 +0100)]
Add failing test for issue 84

see https://github.com/libgit2/libgit2/issues#issue/84

13 years agoFix gitfo_mv() behavior when running on Windows
nulltoken [Tue, 22 Mar 2011 18:45:01 +0000 (19:45 +0100)]
Fix gitfo_mv() behavior when running on Windows

When the system temporary folder is located on a different volume than the working directory into which libgit2 is executing, MoveFileEx() requires an additional flag.

13 years agoSwitch from time_t to git_time_t
nulltoken [Sun, 20 Mar 2011 17:36:25 +0000 (18:36 +0100)]
Switch from time_t to git_time_t

git_time_t is defined as a signed 64 integer. This allows a true predictable multiplatform behavior.

13 years agoCorrected the header include directory in doxygen conf
Tim Branyen [Tue, 22 Mar 2011 03:27:54 +0000 (23:27 -0400)]
Corrected the header include directory in doxygen conf

13 years agoAlways free the parents of a revwalk commit
Vicent Marti [Tue, 22 Mar 2011 18:26:01 +0000 (20:26 +0200)]
Always free the parents of a revwalk commit

Thanks to Carlos Martín Nieto for spotting this.

13 years agoAdd getters for `git_odb_object`
Vicent Marti [Mon, 21 Mar 2011 18:28:02 +0000 (20:28 +0200)]
Add getters for `git_odb_object`

13 years agoFix MSVC warnings when building threads
Vicent Marti [Mon, 21 Mar 2011 17:44:43 +0000 (19:44 +0200)]
Fix MSVC warnings when building threads

13 years agorefs loose_lookup: also free the buffer on success
Carlos Martín Nieto [Tue, 22 Mar 2011 11:47:53 +0000 (12:47 +0100)]
refs loose_lookup: also free the buffer on success

Free the ref_file buffer at the end of the function also on
success. This fixes a small memory leak.

13 years agoUpdate CMakeLists.txt to support threadsafe
Vicent Marti [Mon, 21 Mar 2011 17:39:06 +0000 (19:39 +0200)]
Update CMakeLists.txt to support threadsafe

13 years agoFix MSVC warnings
Vicent Marti [Mon, 21 Mar 2011 17:27:45 +0000 (19:27 +0200)]
Fix MSVC warnings

13 years agoI broke your bindings
Vicent Marti [Fri, 18 Mar 2011 17:38:49 +0000 (19:38 +0200)]
I broke your bindings

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>
13 years agoThread safe cache
Vicent Marti [Wed, 16 Mar 2011 19:35:51 +0000 (21:35 +0200)]
Thread safe cache

13 years agoFix headers for the new Revision Walker
Vicent Marti [Wed, 16 Mar 2011 21:59:09 +0000 (23:59 +0200)]
Fix headers for the new Revision Walker

The "oid.h" header is now included instead of "object.h".

The old "revwalk.h" header has been removed; it was empty.

13 years agoRefs are now always in-sync on disk
Vicent Marti [Wed, 16 Mar 2011 21:13:28 +0000 (23:13 +0200)]
Refs are now always in-sync on disk

13 years agoDefine NO_GZIP in zconf.h instead of at compile time
Vicent Marti [Wed, 16 Mar 2011 21:02:31 +0000 (23:02 +0200)]
Define NO_GZIP in zconf.h instead of at compile time

13 years agoChange the Revwalk reset behavior to the old version
Vicent Marti [Tue, 15 Mar 2011 23:53:25 +0000 (01:53 +0200)]
Change the Revwalk reset behavior to the old version

The `reset` call now removes the pushed commits so we can reuse
the revwalker. The API documentation has been updated with the details.

13 years agoFix signature in `git_repository_gc`
Vicent Marti [Tue, 15 Mar 2011 23:10:40 +0000 (01:10 +0200)]
Fix signature in `git_repository_gc`

The method returns an int with the amount of objects free'd

13 years agoExport `git_repository_gc` properly
Vicent Marti [Tue, 15 Mar 2011 23:07:06 +0000 (01:07 +0200)]
Export `git_repository_gc` properly

One of my brainfarts made me export it as `git_repository_close` instead
of GC. Duh.

13 years agoExport `git_strarray_free` instead of inlining
Vicent Marti [Tue, 15 Mar 2011 23:06:15 +0000 (01:06 +0200)]
Export `git_strarray_free` instead of inlining

That way non-C bindings can use it.

13 years agoProperly free commit a commit list in revwalk
Vicent Marti [Tue, 15 Mar 2011 23:04:17 +0000 (01:04 +0200)]
Properly free commit a commit list in revwalk

The commit list was not being properly free'd when a walk was stopped
halfway through.

13 years agoRevert changes in wscript file
Vicent Marti [Tue, 15 Mar 2011 19:19:02 +0000 (21:19 +0200)]
Revert changes in wscript file

13 years agoAdd proper threading support to libgit2
Vicent Marti [Tue, 15 Mar 2011 19:04:41 +0000 (21:04 +0200)]
Add proper threading support to libgit2

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>
13 years agoDo not segfault when listing unpacked references
Vicent Marti [Tue, 15 Mar 2011 17:55:01 +0000 (19:55 +0200)]
Do not segfault when listing unpacked references

13 years agoDebug assertion when using an initialized hashtable
Vicent Marti [Tue, 15 Mar 2011 17:54:45 +0000 (19:54 +0200)]
Debug assertion when using an initialized hashtable

13 years agoFix compilation warnings in ZLib (MSVC)
Vicent Marti [Tue, 15 Mar 2011 17:46:38 +0000 (19:46 +0200)]
Fix compilation warnings in ZLib (MSVC)

Yes, we are changing the Zlib code. This is dangerous and uncool.
Fortunately, these are just some implicit casts.

13 years agoRemove duplicate refs in `git_reference_listall`
Vicent Marti [Tue, 15 Mar 2011 03:38:50 +0000 (05:38 +0200)]
Remove duplicate refs in `git_reference_listall`

13 years agoUse a more sane zconf.f when building Zlib
Vicent Marti [Tue, 15 Mar 2011 02:03:54 +0000 (04:03 +0200)]
Use a more sane zconf.f when building Zlib

13 years agoAdd nodegit to the README
Vicent Marti [Tue, 15 Mar 2011 01:31:52 +0000 (03:31 +0200)]
Add nodegit to the README

13 years agoAdd ZLib as a built-in dependency
Vicent Marti [Tue, 15 Mar 2011 01:25:44 +0000 (03:25 +0200)]
Add ZLib as a built-in dependency

I don't know if this is good or bad. This lets libgit2 compile cleanly
on any platforms without any external dependencies, but adds a little
bit of bloat...

Let's test this out and see what happens.

13 years agoAdd test case for issue GH-86
Ben Noordhuis [Sun, 13 Mar 2011 23:33:45 +0000 (00:33 +0100)]
Add test case for issue GH-86