]> git.proxmox.com Git - libgit2.git/log
libgit2.git
13 years agoMerge pull request #168 from nulltoken/isolate_refs_tests.
Vicent Martí [Sun, 1 May 2011 19:43:30 +0000 (12:43 -0700)]
Merge pull request #168 from nulltoken/isolate_refs_tests.

Isolate "writing" refs tests in a temporary folder

13 years agoChange implementation of refs tests that alter the current repository to make them...
nulltoken [Sun, 1 May 2011 19:35:32 +0000 (21:35 +0200)]
Change implementation of refs tests that alter the current repository to make them run against a temporary clone of the test repository

13 years agopack-odb: Check `mtime` instead of folder size
Vicent Marti [Sun, 1 May 2011 18:31:58 +0000 (21:31 +0300)]
pack-odb: Check `mtime` instead of folder size

Do not check the folder's size to detect new packfiles at runtime. This
doesn't work on Win32.

13 years agoMerged pull request #115 from jpfender/index-flags.
Vicent Martí [Sat, 23 Apr 2011 21:39:04 +0000 (14:39 -0700)]
Merged pull request #115 from jpfender/index-flags.

index.h: Add IDXENTRY flags needed for index operations

13 years agoMerged pull request #135 from carlosmn/valgrind.
Vicent Martí [Sat, 23 Apr 2011 21:37:56 +0000 (14:37 -0700)]
Merged pull request #135 from carlosmn/valgrind.

Fix memory leaks in the tests

13 years agoMerged pull request #139 from jpfender/merge-head-file.
Vicent Martí [Sat, 23 Apr 2011 21:36:01 +0000 (14:36 -0700)]
Merged pull request #139 from jpfender/merge-head-file.

refs: Allow MERGE_HEAD in normalize_name()

13 years agoindex: Refactor add/replace methods
Vicent Marti [Sat, 23 Apr 2011 21:31:43 +0000 (00:31 +0300)]
index: Refactor add/replace methods

Removed the optional `replace` argument, we now have 4 add methods:

`git_index_add`: add or update from path
`git_index_add2`: add or update from struct
`git_index_append`: add without replacing from path
`git_index_append2`: add without replacing from struct

Yes, this breaks the bindings.

13 years agoMerged pull request #140 from jpfender/insert-replace.
Vicent Martí [Sat, 23 Apr 2011 21:08:17 +0000 (14:08 -0700)]
Merged pull request #140 from jpfender/insert-replace.

index: Allow user to toggle whether to replace an index entry

13 years agoMerged pull request #143 from nordsturm/fix_loop.
Vicent Martí [Sat, 23 Apr 2011 21:01:01 +0000 (14:01 -0700)]
Merged pull request #143 from nordsturm/fix_loop.

Fix going into infinite loop in read_header_loose()

13 years agoFix conversion warning in MSVC
Vicent Marti [Sat, 23 Apr 2011 20:59:38 +0000 (23:59 +0300)]
Fix conversion warning in MSVC

13 years agoFix going into infinite loop in read_header_loose()
Sergey Nikishin [Fri, 22 Apr 2011 13:36:28 +0000 (17:36 +0400)]
Fix going into infinite loop in read_header_loose()

read_header_loose causes infinite loop on this file:
$ cat ../libcppgit/bin/sample-repo/test_mailbox/.git/objects/8f/e274605cbc740a2a957f44b2722a8a73915a09 | base64
eAErKUpNVTAzYzA0MDAzMVHISUxKzSlmWLgkuyN5+rxr6juMPR2EmN8s7Vl9D6oiN7UkkcHJdLbl
7Z3N/oxfE0W8wrSbuFRkAwDFfBn1

13 years agoMerged pull request #138 from trentm/development.
Vicent Martí [Thu, 21 Apr 2011 22:22:37 +0000 (15:22 -0700)]
Merged pull request #138 from trentm/development.

fix solaris build
---
Before this patch the build failure looked like:

...
../../deps/zlib/inffast.c: In function `inflate_fast':
../../deps/zlib/inffast.c:324: warning: visibility attribute not supported in this configuration; ignored
[34/38] c: src/revwalk.c -> build/shared/src/revwalk.c.0.o
../../deps/zlib/inftrees.c: In function `inflate_table':
../../deps/zlib/inftrees.c:330: warning: visibility attribute not supported in this configuration; ignored
[35/38] c: deps/zlib/zutil.c -> build/shared/deps/zlib/zutil.c.0.o
[36/38] c: deps/zlib/trees.c -> build/shared/deps/zlib/trees.c.0.o
../../deps/zlib/zutil.c: In function `zcalloc':
../../deps/zlib/zutil.c:308: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/zutil.c: In function `zcfree':
../../deps/zlib/zutil.c:316: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c:1244: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c:1244: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c: In function `_tr_init':
../../deps/zlib/trees.c:410: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c: In function `_tr_align':
../../deps/zlib/trees.c:919: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c: In function `_tr_stored_block':
../../deps/zlib/trees.c:883: warning: visibility attribute not supported in this configuration; ignored

../../deps/zlib/trees.c: In function `_tr_flush_block':
../../deps/zlib/trees.c:1020: warning: visibility attribute not supported in this configuration; ignored
../../deps/zlib/trees.c: In function `_tr_tally':
../../deps/zlib/trees.c:1071: warning: visibility attribute not supported in this configuration; ignored
[37/38] cshlib: build/shared/src/blob.c.0.o build/shared/src/cache.c.0.o build/shared/src/commit.c.0.o build/shared/src/delta-apply.c.0.o build/shared/src/errors.c.0.o build/shared/src/filebuf.c.0.o build/shared/src/fileops.c.0.o build/shared/src/hash.c.0.o build/shared/src/hashtable.c.0.o build/shared/src/index.c.0.o build/shared/src/object.c.0.o build/shared/src/odb.c.0.o build/shared/src/odb_loose.c.0.o build/shared/src/odb_pack.c.0.o build/shared/src/oid.c.0.o build/shared/src/pqueue.c.0.o build/shared/src/refs.c.0.o build/shared/src/repository.c.0.o build/shared/src/revwalk.c.0.o build/shared/src/signature.c.0.o build/shared/src/tag.c.0.o build/shared/src/thread-utils.c.0.o build/shared/src/tree.c.0.o build/shared/src/util.c.0.o build/shared/src/vector.c.0.o build/shared/src/unix/map.c.0.o build/shared/src/backends/hiredis.c.0.o build/shared/src/backends/sqlite.c.0.o build/shared/deps/zlib/adler32.c.0.o build/shared/deps/zlib/deflate.c.0.o build/shared/deps/zlib/inffast.c.0.o build/shared/deps/zlib/inflate.c.0.o build/shared/deps/zlib/inftrees.c.0.o build/shared/deps/zlib/trees.c.0.o build/shared/deps/zlib/zutil.c.0.o build/shared/src/block-sha1/sha1.c.0.o -> build/shared/libgit2.so
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol zcfree: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol zcalloc: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _length_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _dist_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _length_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _dist_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _dist_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _length_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _dist_code: a GOT relative relocation must reference a local symbol
ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol _dist_code: a GOT relative relocation must reference a local symbol
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/node/src/libgit2/build/shared'
Build failed
 -> task failed (exit status 1):
        {task 138650764: cshlib blob.c.0.o,cache.c.0.o,commit.c.0.o,delta-apply.c.0.o,errors.c.0.o,filebuf.c.0.o,fileops.c.0.o,hash.c.0.o,hashtable.c.0.o,index.c.0.o,object.c.0.o,odb.c.0.o,odb_loose.c.0.o,odb_pack.c.0.o,oid.c.0.o,pqueue.c.0.o,refs.c.0.o,repository.c.0.o,revwalk.c.0.o,signature.c.0.o,tag.c.0.o,thread-utils.c.0.o,tree.c.0.o,util.c.0.o,vector.c.0.o,map.c.0.o,hiredis.c.0.o,sqlite.c.0.o,adler32.c.0.o,deflate.c.0.o,inffast.c.0.o,inflate.c.0.o,inftrees.c.0.o,trees.c.0.o,zutil.c.0.o,sha1.c.0.o -> libgit2.so}
['/home/node/local/bin/gcc', '', 'src/blob.c.0.o', 'src/cache.c.0.o', 'src/commit.c.0.o', 'src/delta-apply.c.0.o', 'src/errors.c.0.o', 'src/filebuf.c.0.o', 'src/fileops.c.0.o', 'src/hash.c.0.o', 'src/hashtable.c.0.o', 'src/index.c.0.o', 'src/object.c.0.o', 'src/odb.c.0.o', 'src/odb_loose.c.0.o', 'src/odb_pack.c.0.o', 'src/oid.c.0.o', 'src/pqueue.c.0.o', 'src/refs.c.0.o', 'src/repository.c.0.o', 'src/revwalk.c.0.o', 'src/signature.c.0.o', 'src/tag.c.0.o', 'src/thread-utils.c.0.o', 'src/tree.c.0.o', 'src/util.c.0.o', 'src/vector.c.0.o', 'src/unix/map.c.0.o', 'src/backends/hiredis.c.0.o', 'src/backends/sqlite.c.0.o', 'deps/zlib/adler32.c.0.o', 'deps/zlib/deflate.c.0.o', 'deps/zlib/inffast.c.0.o', 'deps/zlib/inflate.c.0.o', 'deps/zlib/inftrees.c.0.o', 'deps/zlib/trees.c.0.o', 'deps/zlib/zutil.c.0.o', 'src/block-sha1/sha1.c.0.o', '-o', '', '/home/node/src/libgit2/build/shared/libgit2.so', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-shared', '-Wl,-h,libgit2.so.0']
...

If helpful, here is the equivalent error with varnish: http://www.varnish-cache.org/trac/ticket/852
and the autoconf/configure handling for the equivalent in python: http://hg.python.org/cpython/file/96e0e79d33de/Modules/zlib/configure#l513

So a better fix would probably be to reproduce that configure logic (see similar in the Varnish patch) ... but I'm not sure if shelling out to the C compiler (however waf spells that) is wanted in wscript here.

It would be great to have a libgit2 release with the quicker fix for Solaris. My actual issue is with building node-gitteh.

Thanks,
Trent

13 years agoMerged pull request #142 from potyl/development.
Vicent Martí [Thu, 21 Apr 2011 22:20:46 +0000 (15:20 -0700)]
Merged pull request #142 from potyl/development.

LIBGIT2_VER_MINOR now matches LIBGIT2_VERSION (0.11.0)
---
LIBGIT2_VER_MINOR was left at 10 instead of 11.

13 years agoLIBGIT2_VER_MINOR now matches LIBGIT2_VERSION (0.11.0)
Emmanuel Rodriguez [Thu, 21 Apr 2011 19:21:44 +0000 (21:21 +0200)]
LIBGIT2_VER_MINOR now matches LIBGIT2_VERSION (0.11.0)

LIBGIT2_VER_MINOR was left at 10 instead of 11.

13 years agoindex: Allow user to toggle whether to replace an index entry
Jakob Pfender [Thu, 21 Apr 2011 08:40:54 +0000 (10:40 +0200)]
index: Allow user to toggle whether to replace an index entry

When in the middle of a merge, the index needs to contain several files
with the same name. git_index_insert() used to prevent this by not adding a new entry if an entry with the same name already existed.

13 years agorefs: Allow MERGE_HEAD in normalize_name()
Jakob Pfender [Thu, 21 Apr 2011 08:38:37 +0000 (10:38 +0200)]
refs: Allow MERGE_HEAD in normalize_name()

Do not return with EINVALIDREFNAME when trying to normalize MERGE_HEAD's
name.

13 years agofix solaris build
Trent Mick [Thu, 21 Apr 2011 05:25:30 +0000 (22:25 -0700)]
fix solaris build

Before this patch the build failure looked like:
    ...
    ../../deps/zlib/inftrees.c:330: warning: visibility attribute not supported in this configuration; ignored
    ...
    ld: fatal: relocation error: R_386_GOTOFF: file deps/zlib/deflate.c.0.o: symbol zcfree: a GOT relative relocation must reference a local symbol
    ...

13 years agoForce position independent code in Linux
Vicent Marti [Fri, 15 Apr 2011 22:58:43 +0000 (01:58 +0300)]
Force position independent code in Linux

13 years agoClose file descriptor when writing a blob
Vicent Marti [Fri, 15 Apr 2011 17:32:31 +0000 (20:32 +0300)]
Close file descriptor when writing a blob

13 years agoRefresh the list of packfiles on each ODB query
Vicent Marti [Fri, 15 Apr 2011 12:12:37 +0000 (15:12 +0300)]
Refresh the list of packfiles on each ODB query

Fixes the issue where object lookups were failing right after a pull on
an open repository.

13 years agoClose an object in packed_find_peel
Carlos Martín Nieto [Wed, 13 Apr 2011 19:57:35 +0000 (21:57 +0200)]
Close an object in packed_find_peel

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agotests: free the test suite name
Carlos Martín Nieto [Wed, 13 Apr 2011 19:55:43 +0000 (21:55 +0200)]
tests: free the test suite name

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agotests: don't leak objects
Carlos Martín Nieto [Wed, 13 Apr 2011 15:44:08 +0000 (17:44 +0200)]
tests: don't leak objects

If we don't create any leaks in the tests, we can use them to search
for leaks in the implementation.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd `git_tag_list`
Vicent Marti [Tue, 12 Apr 2011 22:52:34 +0000 (15:52 -0700)]
Add `git_tag_list`

Lists all the tag references in a repository using a custom callback.
Includes unit tests courtesy of Emeric Fermas <3

13 years agomerge branch development
Jakob Pfender [Mon, 11 Apr 2011 10:38:50 +0000 (12:38 +0200)]
merge branch development

13 years agoFix path normalization tests
Vicent Marti [Sun, 10 Apr 2011 22:25:41 +0000 (15:25 -0700)]
Fix path normalization tests

They were backtracking too deep into the filesystem on Linux, where the
tests were running directly on `tmp/`.

13 years agoUse Z_BEST_SPEED for filebuf deflating
Vicent Marti [Sun, 10 Apr 2011 19:23:55 +0000 (12:23 -0700)]
Use Z_BEST_SPEED for filebuf deflating

This is what Git uses by default for all deflating.

13 years agoImport 'with' from __future__ in the build script
Vicent Marti [Sun, 10 Apr 2011 00:45:38 +0000 (17:45 -0700)]
Import 'with' from __future__ in the build script

13 years agoFix `time_t` conversion on Win32
Vicent Marti [Sat, 9 Apr 2011 23:16:09 +0000 (16:16 -0700)]
Fix `time_t` conversion on Win32

13 years agoFix `gmtime` issues in Win32
Vicent Marti [Sat, 9 Apr 2011 23:06:17 +0000 (16:06 -0700)]
Fix `gmtime` issues in Win32

13 years agoRename `git_signature_new_now`
Vicent Marti [Sat, 9 Apr 2011 22:31:12 +0000 (15:31 -0700)]
Rename `git_signature_new_now`

The new name is more cool.

13 years agoAdd API git_signature_new_now
Carlos Martín Nieto [Tue, 5 Apr 2011 14:15:54 +0000 (16:15 +0200)]
Add API git_signature_new_now

Most tags will have a timestamp of whenever the code is running and
dealing with time and timezones is error-prone. Optimize for this case
by adding a function which causes the signature to be created with a
current timestamp.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix the signature documentation
Carlos Martín Nieto [Thu, 7 Apr 2011 11:27:34 +0000 (13:27 +0200)]
Fix the signature documentation

The parameters are given by '@param name' and not '@name'.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd a few malloc checks
Carlos Martín Nieto [Thu, 7 Apr 2011 12:38:03 +0000 (14:38 +0200)]
Add a few malloc checks

Add checks to see if malloc failed when allocating the tag members and
signature members.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd two new accessors to the repository
nulltoken [Sat, 9 Apr 2011 13:49:44 +0000 (15:49 +0200)]
Add two new accessors to the repository

git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.

13 years agoProperly check `strtol` for errors
Vicent Marti [Sat, 9 Apr 2011 22:22:11 +0000 (15:22 -0700)]
Properly check `strtol` for errors

We are now using a custom `strtol` implementation to make sure we're not
missing any overflow errors.

13 years agoDo not declare variables in the middle of a func
Vicent Marti [Fri, 8 Apr 2011 22:35:25 +0000 (15:35 -0700)]
Do not declare variables in the middle of a func

13 years agoAdd new method `git_repository_is_empty`
Vicent Marti [Fri, 8 Apr 2011 19:42:18 +0000 (12:42 -0700)]
Add new method `git_repository_is_empty`

13 years agoRemove unused variables from test files
Vicent Marti [Fri, 8 Apr 2011 19:41:17 +0000 (12:41 -0700)]
Remove unused variables from test files

13 years agorefs: Fix issue when packing weak tags
Vicent Marti [Fri, 8 Apr 2011 19:14:33 +0000 (12:14 -0700)]
refs: Fix issue when packing weak tags

Weak tags (e.g. tags that point directly to a normal object instead of a
tag object) were failing to be packed.

13 years agotag: don't check twice if an object exists
Carlos Martín Nieto [Wed, 6 Apr 2011 09:59:40 +0000 (11:59 +0200)]
tag: don't check twice if an object exists

Remove the check in git_tag_create_frombuffer as it's done by
tag_create already.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agotag: don't allow tags to non-existent objects
Carlos Martín Nieto [Wed, 6 Apr 2011 08:58:14 +0000 (10:58 +0200)]
tag: don't allow tags to non-existent objects

These indicate an inconsistency in the repository which we've created,
so don't allow them.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
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 agoindex.c: Correctly check whether index contains extended entries
Jakob Pfender [Thu, 7 Apr 2011 14:58:42 +0000 (16:58 +0200)]
index.c: Correctly check whether index contains extended entries

Although write_index() supports writing extended header versions for
index, this was never done as there was no check for extended index
entries.

Introduce function is_index_extended() that checks whether an index
contains extended entries and check whether an index is extended before
writing it to disk, adjusting its version number if necessary.

13 years agoindex.h: Correct values for extended flags
Jakob Pfender [Thu, 7 Apr 2011 14:53:50 +0000 (16:53 +0200)]
index.h: Correct values for extended flags

As libgit2 separates an index entry's 32-bit flag into two 16-bit values
flags and flags_extended, the values of flags_extended need to be
adjusted.

13 years agoMerge branch 'development' into index-flags
Jakob Pfender [Tue, 5 Apr 2011 08:57:41 +0000 (10:57 +0200)]
Merge branch 'development' into index-flags

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 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 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.