]> git.proxmox.com Git - libgit2.git/log
libgit2.git
13 years agotypo: one git_remote_fetchspec should be pushspec
Carlos Martín Nieto [Sat, 9 Jul 2011 15:29:42 +0000 (17:29 +0200)]
typo: one git_remote_fetchspec should be pushspec

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
13 years agostatus: refactor the tests to remove some code duplication
nulltoken [Tue, 12 Jul 2011 09:29:36 +0000 (11:29 +0200)]
status: refactor the tests to remove some code duplication

13 years agoMerge pull request #321 from letolabs/readme
Vicent Martí [Tue, 12 Jul 2011 18:26:25 +0000 (11:26 -0700)]
Merge pull request #321 from letolabs/readme

Add parrot-libgit2 to the list of language bindings in the readme

13 years agoMerge pull request #319 from carlosmn/valgrind
Vicent Martí [Tue, 12 Jul 2011 18:23:12 +0000 (11:23 -0700)]
Merge pull request #319 from carlosmn/valgrind

Fix more memory leaks

13 years agoMerge pull request #318 from schu/ref-fix-leak
Vicent Martí [Tue, 12 Jul 2011 18:22:11 +0000 (11:22 -0700)]
Merge pull request #318 from schu/ref-fix-leak

reference_rename: make sure old_name gets freed

13 years agoAdd parrot-libgit2 to the list of language bindings in the readme
Jonathan "Duke" Leto [Tue, 12 Jul 2011 18:19:42 +0000 (11:19 -0700)]
Add parrot-libgit2 to the list of language bindings in the readme

13 years agostatus: plug some leaks
Carlos Martín Nieto [Tue, 12 Jul 2011 16:08:46 +0000 (18:08 +0200)]
status: plug some leaks

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoDon't leak the buf when testing it
Carlos Martín Nieto [Tue, 12 Jul 2011 16:10:31 +0000 (18:10 +0200)]
Don't leak the buf when testing it

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoreference_rename: make sure old_name gets freed
schu [Tue, 12 Jul 2011 15:53:22 +0000 (17:53 +0200)]
reference_rename: make sure old_name gets freed

Signed-off-by: schu <schu-github@schulog.org>
13 years agoconfig: Rename `del` to `delete
Vicent Marti [Tue, 12 Jul 2011 00:38:20 +0000 (02:38 +0200)]
config: Rename `del` to `delete

13 years agotag: Add creation of lightweight tag
nulltoken [Mon, 11 Jul 2011 14:30:46 +0000 (16:30 +0200)]
tag: Add creation of lightweight tag

13 years agoWhat the fuck was this doing in `src`?
Vicent Marti [Mon, 11 Jul 2011 17:28:07 +0000 (19:28 +0200)]
What the fuck was this doing in `src`?

13 years agoMerge pull request #315 from belkiss/development
Vicent Martí [Mon, 11 Jul 2011 11:19:46 +0000 (04:19 -0700)]
Merge pull request #315 from belkiss/development

Finish to hide git_pkt from external API.

13 years agoFinish to hide git_pkt from external API.
Lambert CLARA [Mon, 11 Jul 2011 11:04:36 +0000 (13:04 +0200)]
Finish to hide git_pkt from external API.

13 years agoMerge pull request #314 from nulltoken/ntk/fix-reflog
Vicent Martí [Mon, 11 Jul 2011 01:02:33 +0000 (18:02 -0700)]
Merge pull request #314 from nulltoken/ntk/fix-reflog

reflog: Fix reflog writer/reader

13 years agoRemove the last reference of git_net_direction enum
Lambert CLARA [Sat, 9 Jul 2011 12:53:00 +0000 (14:53 +0200)]
Remove the last reference of git_net_direction enum

13 years agoCleanup external API
Vicent Marti [Mon, 11 Jul 2011 00:58:00 +0000 (02:58 +0200)]
Cleanup external API

Some of the WIP API calls have been hidden in preparation for the next
minor release.

13 years agoinclude: Fix unmatched params in documentation
Vicent Marti [Sat, 9 Jul 2011 13:13:32 +0000 (15:13 +0200)]
include: Fix unmatched params in documentation

13 years agoreflog: Fix reflog writer/reader
nulltoken [Sun, 10 Jul 2011 05:48:52 +0000 (07:48 +0200)]
reflog: Fix reflog writer/reader

 - Use a space to separate oids and signature
 - Enforce test coverage
 - Make test run in a temporary folder in order not to alter the test repository

13 years agoMerge pull request #312 from nulltoken/patch-2
Vicent Martí [Sat, 9 Jul 2011 13:45:30 +0000 (06:45 -0700)]
Merge pull request #312 from nulltoken/patch-2

Fix MSVC compilation warning

13 years agoFix MSVC compilation warning
nulltoken [Sat, 9 Jul 2011 13:36:18 +0000 (06:36 -0700)]
Fix MSVC compilation warning

13 years agostatus: Cleanup
Vicent Marti [Sat, 9 Jul 2011 13:05:14 +0000 (15:05 +0200)]
status: Cleanup

The `hashfile` function has been moved to ODB, next to `git_odb_hash`.

Global state has been removed from the dirent call in `status.c`,
because global state is killing the rainforest and causing global
warming.

13 years agostatus: nonexistent file with git_status_file()
Jason Penny [Sat, 9 Jul 2011 04:08:52 +0000 (00:08 -0400)]
status: nonexistent file with git_status_file()

Throws GIT_ENOTFOUND error if given a filename that is not in
HEAD, index, nor the work tree.

13 years agostatus: consolidate some test code
Jason Penny [Sat, 9 Jul 2011 03:51:05 +0000 (23:51 -0400)]
status: consolidate some test code

Refactored copy of test repo to a function.

13 years agostatus: handle subdirs for git_status_file
Jason Penny [Sat, 25 Jun 2011 00:36:53 +0000 (20:36 -0400)]
status: handle subdirs for git_status_file

13 years agostatus: add subdir to test repo
Jason Penny [Fri, 24 Jun 2011 22:35:06 +0000 (18:35 -0400)]
status: add subdir to test repo

13 years agostatus: get status for single file
Jason Penny [Thu, 23 Jun 2011 22:51:22 +0000 (18:51 -0400)]
status: get status for single file

Add git_status_file to be able to retrieve status of single file by
supplying a path.

13 years agostatus: get file statuses and run callback
Jason Penny [Wed, 22 Jun 2011 22:31:20 +0000 (18:31 -0400)]
status: get file statuses and run callback

Add git_status_foreach() to run a callback on each file passing the path
and a status value.

13 years agostatus: new test repo
Jason Penny [Wed, 22 Jun 2011 22:23:57 +0000 (18:23 -0400)]
status: new test repo

13 years agostatus: get blob object id of file on disk
Jason Penny [Wed, 22 Jun 2011 22:19:46 +0000 (18:19 -0400)]
status: get blob object id of file on disk

Add git_status_hashfile() to get blob's object id for a file without adding
it to the object database or needing a repository at all.
This functionality is similar to `git hash-object` without '-w'.

13 years agoUpdate tests/NAMING
Jason Penny [Sat, 9 Jul 2011 02:44:15 +0000 (22:44 -0400)]
Update tests/NAMING

13 years agotsort: Remove unused CLZ methods
Vicent Marti [Sat, 9 Jul 2011 11:27:08 +0000 (13:27 +0200)]
tsort: Remove unused CLZ methods

13 years agoMerge pull request #311 from nulltoken/ntk/fix-win32-specs
Vicent Martí [Sat, 9 Jul 2011 11:24:23 +0000 (04:24 -0700)]
Merge pull request #311 from nulltoken/ntk/fix-win32-specs

Ntk/fix win32 specs

13 years agowin32: replace usage of _MSV_VER with _MSC_VER
nulltoken [Sat, 9 Jul 2011 06:41:02 +0000 (08:41 +0200)]
win32: replace usage of _MSV_VER with _MSC_VER

13 years agoFix MSVC compilation warning
nulltoken [Sat, 9 Jul 2011 06:36:37 +0000 (08:36 +0200)]
Fix MSVC compilation warning

13 years agoRemove unused methods
Vicent Marti [Sat, 9 Jul 2011 00:37:16 +0000 (02:37 +0200)]
Remove unused methods

The direct-writes commit left some (slow) internals methods that
were no longer needed. These have been removed.

Also, the Reflog code was using the old `git_signature__write`, so
it has been rewritten to use a normal buffer and the new `writebuf`
signature writer. It's now slightly simpler and faster.

13 years agoodb: Direct writes are back
Vicent Marti [Sat, 9 Jul 2011 00:10:46 +0000 (02:10 +0200)]
odb: Direct writes are back

DIRECT WRITES ARE BACK AND FASTER THAN EVER. The streaming writer to the
ODB was an overkill for the smaller objects like Commit and Tags; most
of the streaming logic was taking too long.

This commit makes Commits, Tags and Trees to be built-up in memory, and
then written to disk in 2 pushes (header + data), instead of streaming
everything.

This is *always* faster, even for big files (since the git_filebuf class
still does streaming writes when the memory cache overflows). This is
also a gazillion lines of code smaller, because we don't have to
precompute the final size of the object before starting the stream (this
was kind of defeating the point of streaming, anyway).

Blobs are still written with full streaming instead of loading them in
memory, since this is still the fastest way.

A new `git_buf` class has been added. It's missing some features, but
it'll get there.

13 years agoposix: Portable `vsnprintf`
Vicent Marti [Fri, 8 Jul 2011 21:01:37 +0000 (23:01 +0200)]
posix: Portable `vsnprintf`

Our good, lovely folks at Microsoft decided that there was no good
reason to make `vsnprintf` compilant with the C standard, so that
function in Windows returns -1 on overflow, instead of returning the
actual byte count needed to write the full string.

We now handle this situation more gracefully with the POSIX
compatibility layer, by returning the needed byte size using an
auxiliary method instead of blindly resizing the target buffer until it
fits.

This means we can now support `printf`s of any size by allocating a
temporary buffer. That's good.

13 years agosignature: Fix optional header
Vicent Marti [Fri, 8 Jul 2011 16:31:05 +0000 (18:31 +0200)]
signature: Fix optional header

13 years agoreflog: add API to read or write a reference log
schu [Tue, 28 Jun 2011 12:13:12 +0000 (14:13 +0200)]
reflog: add API to read or write a reference log

So far libgit2 didn't support reference logs (reflog). Add a new
git_reflog_* API for basic reading and writing of reflogs:

* git_reflog_read
* git_reflog_write
* git_reflog_free

Signed-off-by: schu <schu-github@schulog.org>
13 years agogit_signature__write: make header optionally
schu [Sun, 19 Jun 2011 21:06:53 +0000 (23:06 +0200)]
git_signature__write: make header optionally

Signed-off-by: schu <schu-github@schulog.org>
13 years agoindex: Return `GIT_ENOTFOUND` when an entry cannot be opened
Vicent Marti [Fri, 8 Jul 2011 16:22:44 +0000 (18:22 +0200)]
index: Return `GIT_ENOTFOUND` when an entry cannot be opened

13 years agoMerge pull request #309 from schu/rr-flaw
Vicent Martí [Fri, 8 Jul 2011 16:21:30 +0000 (09:21 -0700)]
Merge pull request #309 from schu/rr-flaw

reference_rename: fix flaw in force-renaming

13 years agoMerge pull request #308 from schu/unused-but-set-var
Vicent Martí [Fri, 8 Jul 2011 16:21:13 +0000 (09:21 -0700)]
Merge pull request #308 from schu/unused-but-set-var

tsort: remove unused but set variable

13 years agoreference_rename: fix flaw in force-renaming
schu [Thu, 7 Jul 2011 19:24:12 +0000 (21:24 +0200)]
reference_rename: fix flaw in force-renaming

reference_rename didn't respect the force flag. Fixed.

Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
13 years agoreference_renaming: add additional tests
nulltoken [Thu, 7 Jul 2011 15:49:55 +0000 (17:49 +0200)]
reference_renaming: add additional tests

Add some more test checking forced reference renaming.

Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Acked-by: schu <schu-github@schulog.org>
13 years agotsort: remove unused but set variable
schu [Thu, 7 Jul 2011 16:14:53 +0000 (18:14 +0200)]
tsort: remove unused but set variable

Signed-off-by: schu <schu-github@schulog.org>
13 years agoindex: Fix memory leak on OOM
Vicent Marti [Thu, 7 Jul 2011 15:56:10 +0000 (17:56 +0200)]
index: Fix memory leak on OOM

13 years agotag: add pattern based retrieval of list of tag names
nulltoken [Thu, 7 Jul 2011 11:47:45 +0000 (13:47 +0200)]
tag: add pattern based retrieval of list of tag names

13 years agotsort: fix wrong header inclusion
nulltoken [Thu, 7 Jul 2011 11:38:47 +0000 (13:38 +0200)]
tsort: fix wrong header inclusion

13 years agotest-core: Fix warning in uniq test
Vicent Marti [Thu, 7 Jul 2011 10:23:47 +0000 (12:23 +0200)]
test-core: Fix warning in uniq test

13 years agoFix MSVC compilation warnings
nulltoken [Thu, 7 Jul 2011 08:11:00 +0000 (10:11 +0200)]
Fix MSVC compilation warnings

13 years agovector: Timsort all of the things
Vicent Marti [Wed, 6 Jul 2011 23:46:20 +0000 (01:46 +0200)]
vector: Timsort all of the things

Drop the GLibc implementation of Merge Sort and replace it with Timsort.

The algorithm has been tuned to work on arrays of pointers (void **),
so there's no longer a need to abstract the byte-width of each element
in the array.

All the comparison callbacks now take pointers-to-elements, not
pointers-to-pointers, so there's now one less level of dereferencing.

E.g.

 int index_cmp(const void *a, const void *b)
 {
- const git_index_entry *entry_a = *(const git_index_entry **)(a);
+ const git_index_entry *entry_a = (const git_index_entry *)(a);

The result is up to a 40% speed-up when sorting vectors. Memory usage
remains lineal.

A new `bsearch` implementation has been added, whose callback also
supplies pointer-to-elements, to uniform the Vector API again.

13 years agotest: Abort when the temp workdir cannot be created
Vicent Marti [Wed, 6 Jul 2011 23:04:14 +0000 (01:04 +0200)]
test: Abort when the temp workdir cannot be created

13 years agoMerge pull request #306 from carlosmn/development
Vicent Martí [Wed, 6 Jul 2011 23:58:06 +0000 (16:58 -0700)]
Merge pull request #306 from carlosmn/development

Fix network MSYS compilation

13 years agoMerge pull request #307 from nulltoken/patch-1
Vicent Martí [Wed, 6 Jul 2011 19:29:22 +0000 (12:29 -0700)]
Merge pull request #307 from nulltoken/patch-1

Fix MSVC compilation warnings

13 years agoFix MSVC compilation warnings
nulltoken [Wed, 6 Jul 2011 19:27:51 +0000 (12:27 -0700)]
Fix MSVC compilation warnings

13 years agoMerge pull request #296 from kiryl/index-optimization
Vicent Martí [Wed, 6 Jul 2011 17:55:06 +0000 (10:55 -0700)]
Merge pull request #296 from kiryl/index-optimization

Index optimization

13 years agorevwalk: Properly mark uninteresting commits
Vicent Marti [Wed, 6 Jul 2011 17:46:41 +0000 (19:46 +0200)]
revwalk: Properly mark uninteresting commits

13 years agorefs: Cleanup reference renaming
Vicent Marti [Wed, 6 Jul 2011 16:08:13 +0000 (18:08 +0200)]
refs: Cleanup reference renaming

`git_futils_rmdir_r`: rename, clean up.

`git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack
or things will get ugly very fast. We can reuse the same buffer.

13 years agoMerge pull request #303 from schu/ref-rename
Vicent Martí [Wed, 6 Jul 2011 13:54:11 +0000 (06:54 -0700)]
Merge pull request #303 from schu/ref-rename

reference_rename: git compliant reference renaming v2

13 years agoFix network MSYS compilation
Carlos Martín Nieto [Wed, 6 Jul 2011 07:11:03 +0000 (09:11 +0200)]
Fix network MSYS compilation

MSYS/MinGW uses winsock but obviously doesn't set _MSC_VER. Use _WIN32
to decide whether to use winsock or BSD headers. Also remove these
headers from src/transport_git.c altogether, as they are not needed.

MSYS is very conservative, so we have to tell it that we don't care
about versions of Windows lower than WindowsXP. We also need to tell
CMake to add ws2_32 to the libraries list and we shouldn't add the
-fPIC option, to MSYS because it complains that it does it anyway.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
13 years agoRemove duplicated recursive directory removal related code
nulltoken [Sun, 3 Jul 2011 20:27:05 +0000 (22:27 +0200)]
Remove duplicated recursive directory removal related code

13 years agoFix windows specific issues
nulltoken [Sun, 3 Jul 2011 12:42:32 +0000 (14:42 +0200)]
Fix windows specific issues

 - msvc compilation warnings
 - not released file handle that prevents file removal

13 years agoreference_rename: git compliant reference renaming
schu [Tue, 14 Jun 2011 13:16:43 +0000 (15:16 +0200)]
reference_rename: git compliant reference renaming

So far libgit2 didn't handle the following scenarios:

* Rename of reference m   -> m/m
* Rename of reference n/n -> n

Fixed.

Since we don't write reflogs, we have to delete any old reflog for the
renamed reference. Otherwise git.git will possibly fail when it finds
invalid logs.

Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
13 years agoAdd tests for git_futils_rmdir_resurs()
schu [Thu, 9 Jun 2011 17:56:42 +0000 (19:56 +0200)]
Add tests for git_futils_rmdir_resurs()

Signed-off-by: schu <schu-github@schulog.org>
13 years agofileops: add git_futils_rmdir_recurs()
schu [Thu, 9 Jun 2011 17:51:33 +0000 (19:51 +0200)]
fileops: add git_futils_rmdir_recurs()

git_futils_rmdir_recurs() shall remove the given directory and all
subdirectories. This happens only if the directories are empty.

Signed-off-by: schu <schu-github@schulog.org>
13 years agofileops: add convenience function is_dot_or_dotdot()
schu [Thu, 9 Jun 2011 16:11:11 +0000 (18:11 +0200)]
fileops: add convenience function is_dot_or_dotdot()

Signed-off-by: schu <schu-github@schulog.org>
13 years agoAdd test case checking renaming of a branch to a new name prefixed with
schu [Sun, 29 May 2011 14:46:24 +0000 (16:46 +0200)]
Add test case checking renaming of a branch to a new name prefixed with
the old name succeeds, e.g. refs/heads/foo -> refs/heads/foo/bar

Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
13 years agobuild: Add simple Makefile for embedding the library
Vicent Marti [Wed, 6 Jul 2011 00:14:30 +0000 (02:14 +0200)]
build: Add simple Makefile for embedding the library

Run `make -f Makefile.embed` to get a `libgit2.a` with no dependencies
and no configuration on any Unix-like system.

The generated library can be linked with any piece of software without
licensing issues.

Have fun.

13 years agofnmatch: Fix compilation under Windows
Vicent Marti [Tue, 5 Jul 2011 23:44:15 +0000 (01:44 +0200)]
fnmatch: Fix compilation under Windows

13 years agofnmatch: Use native on Unix, emulate on Win32
Vicent Marti [Tue, 5 Jul 2011 23:04:04 +0000 (01:04 +0200)]
fnmatch: Use native on Unix, emulate on Win32

13 years agoAlso update local_connect's unused var name for MSVC
Carlos Martín Nieto [Tue, 5 Jul 2011 19:15:03 +0000 (21:15 +0200)]
Also update local_connect's unused var name for MSVC

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMerge pull request #305 from nulltoken/patch-6
Vicent Martí [Tue, 5 Jul 2011 19:32:20 +0000 (12:32 -0700)]
Merge pull request #305 from nulltoken/patch-6

repository: fix typo'ed assert

13 years agorepository: fix typo'ed assert
nulltoken [Tue, 5 Jul 2011 18:00:32 +0000 (11:00 -0700)]
repository: fix typo'ed assert

13 years agoMerge pull request #304 from carlosmn/config
Vicent Martí [Tue, 5 Jul 2011 17:50:13 +0000 (10:50 -0700)]
Merge pull request #304 from carlosmn/config

Restore config10 test file

13 years agoRestore config10 test file
Carlos Martín Nieto [Tue, 5 Jul 2011 15:44:51 +0000 (17:44 +0200)]
Restore config10 test file

Removing a section variable doesn't remove its section
header. Overwrite the config10 file so there are no changes after the
test is run.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoindex: introduce git_index_uniq() function
Kirill A. Shutemov [Fri, 1 Jul 2011 22:08:42 +0000 (01:08 +0300)]
index: introduce git_index_uniq() function

It removes all entries with equal path except last added.

On large indexes git_index_append() + git_index_uniq() before writing is
*much* faster, than git_index_add().

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agovector: implement git_vector_uniq()
Kirill A. Shutemov [Fri, 1 Jul 2011 21:41:49 +0000 (00:41 +0300)]
vector: implement git_vector_uniq()

The routine remove duplictes from the vector. Only the last added element
of elements with equal keys remains in the vector.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agovector, index: use git__msort() for vector sorting
Kirill A. Shutemov [Thu, 30 Jun 2011 21:48:37 +0000 (00:48 +0300)]
vector, index: use git__msort() for vector sorting

Index operation use git_vector_sort() to sort index entries. Since index
support adding duplicates (two or more entries with the same path), it's
important to preserve order of elements. Preserving order of elements
allows to make decisions based on order. For example it's possible to
implement function witch removes all duplicates except last added.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agoutil: introduce merge sort routine
Kirill A. Shutemov [Thu, 30 Jun 2011 21:34:23 +0000 (00:34 +0300)]
util: introduce merge sort routine

In some cases it's important to preserve order of elements with equal
keys (stable sort). qsort(3) doesn't define order of elements with
equal keys.

git__msort() implements merge sort which is stable sort.

Implementation taken from git. Function renamed git_qsort() -> git__msort().

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agoindex: speedup git_index_append()/git_index_append2()
Kirill A. Shutemov [Thu, 30 Jun 2011 20:22:42 +0000 (23:22 +0300)]
index: speedup git_index_append()/git_index_append2()

git_index_find() in index_insert() is useless if replace is not
requested (append). Do not call it in this case.
It speedup git_index_append() *dramatically* on large indexes.

$ cat index_test.c

int main(int argc, char **argv)
{
        git_index *index;
        git_repository *repo;
        git_odb *odb;
        struct git_index_entry entry;
        git_oid tree_oid;
        char tree_hex[41];
        int i;

        git_repository_init(&repo, "/tmp/myrepo", 0);
        odb = git_repository_database(repo);
        git_repository_index(&index, repo);

        memset(&entry, 0, sizeof(entry));
        git_odb_write(&entry.oid, odb, "", 0, GIT_OBJ_BLOB);
        entry.path = "test.file";

        for (i = 0; i < 50000; i++)
                git_index_append2(index, &entry);

        git_tree_create_fromindex(&tree_oid, index);
        git_oid_fmt(tree_hex, &tree_oid);
        tree_hex[40] = '\0';
        printf("tree: %s\n", tree_hex);

        git_index_free(index);
        git_repository_free(repo);

        return 0;
}

Before:
$ time ./index_test
tree: 43f73659c43b651588cc81459d9e25b08721b95d
./index_test  151.19s user 0.05s system 99% cpu 2:31.78 total

After:
$ time ./index_test
tree: 43f73659c43b651588cc81459d9e25b08721b95d
./index_test  0.05s user 0.00s system 94% cpu 0.059 total

About 2573 times speedup on this test :)

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agorepository: Fix unused parameter in Unix systems
Vicent Marti [Tue, 5 Jul 2011 13:38:26 +0000 (15:38 +0200)]
repository: Fix unused parameter in Unix systems

13 years agoMerge pull request #302 from carlosmn/development
Vicent Martí [Tue, 5 Jul 2011 13:35:45 +0000 (06:35 -0700)]
Merge pull request #302 from carlosmn/development

Small fixes in pack_window_open

13 years agoMerge pull request #299 from kiryl/examples-general-warnings
Vicent Martí [Tue, 5 Jul 2011 13:33:28 +0000 (06:33 -0700)]
Merge pull request #299 from kiryl/examples-general-warnings

Fix warning in examples/general.c

13 years agoMerge pull request #297 from nulltoken/patch-5
Vicent Martí [Tue, 5 Jul 2011 13:32:58 +0000 (06:32 -0700)]
Merge pull request #297 from nulltoken/patch-5

Fix MSVC compilation issue

13 years agoSmall fixes in pack_window_open
Carlos Martín Nieto [Tue, 5 Jul 2011 13:09:17 +0000 (15:09 +0200)]
Small fixes in pack_window_open

Check if the window structure has actually been allocated before
trying to access it, and don't leak said structure if the map fails.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMerge pull request #301 from carlosmn/hashtable-include-fix
Vicent Martí [Tue, 5 Jul 2011 13:27:56 +0000 (06:27 -0700)]
Merge pull request #301 from carlosmn/hashtable-include-fix

Include common.h in hashtable.h

13 years agoInclude common.h in hashtable.h
Carlos Martín Nieto [Tue, 5 Jul 2011 12:36:22 +0000 (14:36 +0200)]
Include common.h in hashtable.h

Without this, hashtable.h doesn't know what uint32_t is and the
compiler thinks that it's a function type.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMerge pull request #300 from carlosmn/gsoc2011/master
Vicent Martí [Tue, 5 Jul 2011 11:31:37 +0000 (04:31 -0700)]
Merge pull request #300 from carlosmn/gsoc2011/master

A bit of networking

13 years agoexamples/general: fix misc warnings
Kirill A. Shutemov [Tue, 5 Jul 2011 09:00:18 +0000 (12:00 +0300)]
examples/general: fix misc warnings

examples/general.c:393:25: warning: unused variable ‘reftarget’ [-Wunused-variable]
examples/general.c:357:19: warning: unused variable ‘e’ [-Wunused-variable]
examples/general.c:444:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agoexamples/general: fix warnings on not handled reference type in switch
Kirill A. Shutemov [Tue, 5 Jul 2011 08:54:16 +0000 (11:54 +0300)]
examples/general: fix warnings on not handled reference type in switch

examples/general.c:402:5: warning: enumeration value ‘GIT_REF_INVALID’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_PACKED’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_HAS_PEEL’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_LISTALL’ not handled in switch [-Wswitch]

Signe-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agoexamples/general: fix git_commit_create_v() arguments type
Kirill A. Shutemov [Tue, 5 Jul 2011 08:43:21 +0000 (11:43 +0300)]
examples/general: fix git_commit_create_v() arguments type

general.c:208: warning: passing argument 7 of 'git_commit_create_v' from incompatible pointer type

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
13 years agoFix MSVC compilation issue
nulltoken [Tue, 5 Jul 2011 08:09:37 +0000 (01:09 -0700)]
Fix MSVC compilation issue

13 years agoAdd variable writing tests
Carlos Martín Nieto [Tue, 28 Jun 2011 14:48:04 +0000 (16:48 +0200)]
Add variable writing tests

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd test for section header at end of file
Carlos Martín Nieto [Tue, 28 Jun 2011 14:27:16 +0000 (16:27 +0200)]
Add test for section header at end of file

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoCorrectly detect truncated input in header parsing
Carlos Martín Nieto [Tue, 28 Jun 2011 14:24:51 +0000 (16:24 +0200)]
Correctly detect truncated input in header parsing

If the section header is the last line in the file,
parse_section_header would incorrectly decide that the input had been
truncated.

Fix this by checking whether the actual input line is correctly
formatted.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agogit_config_add_file should rethrow
Carlos Martín Nieto [Tue, 28 Jun 2011 14:08:46 +0000 (16:08 +0200)]
git_config_add_file should rethrow

Otherwise, the information about why there was an error gets lost.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd tests for deleting a config var
Carlos Martín Nieto [Tue, 28 Jun 2011 13:21:44 +0000 (15:21 +0200)]
Add tests for deleting a config var

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd git_config_del to delete a variable
Carlos Martín Nieto [Tue, 28 Jun 2011 13:20:42 +0000 (15:20 +0200)]
Add git_config_del to delete a variable

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>