]> git.proxmox.com Git - libgit2.git/log
libgit2.git
12 years agoremotes: change git_remote_new's signature
Carlos Martín Nieto [Thu, 3 May 2012 18:25:56 +0000 (20:25 +0200)]
remotes: change git_remote_new's signature

Add a fetch refspec arguemnt and make the arguments (name, url,
refspec), as that order makes more sense.

12 years agoremote: add git_remote_add()
Carlos Martín Nieto [Thu, 3 May 2012 14:08:33 +0000 (16:08 +0200)]
remote: add git_remote_add()

Helper function to create a remote with the default settings

12 years agoconfig: don't use freed memory on error
Carlos Martín Nieto [Thu, 3 May 2012 14:07:22 +0000 (16:07 +0200)]
config: don't use freed memory on error

Change the order and set a NULL so we don't try to access freed memory
in case of an error.

12 years agoMerge pull request #674 from nulltoken/topic/GIT_ENOTFOUND
Russell Belfer [Tue, 8 May 2012 17:40:01 +0000 (10:40 -0700)]
Merge pull request #674 from nulltoken/topic/GIT_ENOTFOUND

Improve the interop with bindings

12 years agoMinor error fixes
Carlos Martín Nieto [Tue, 8 May 2012 12:28:21 +0000 (14:28 +0200)]
Minor error fixes

Clear the error in pkt when we notice that the remote is starting to
send the packfile.

Fix the format string for Windows networking errors.

12 years agostatus: Prevent git_status_file() from returning ENOTFOUND when not applicable
nulltoken [Mon, 7 May 2012 19:21:48 +0000 (21:21 +0200)]
status: Prevent git_status_file() from returning ENOTFOUND when not applicable

12 years agorepository: ensure git_repository_discover() returns ENOTFOUND when unable to find...
nulltoken [Mon, 7 May 2012 15:25:16 +0000 (17:25 +0200)]
repository: ensure git_repository_discover() returns ENOTFOUND when unable to find a repository given the constraints

12 years agofileops: replace integer usage with more explicit enum in some git_futils_rmdir_r...
nulltoken [Mon, 7 May 2012 15:04:06 +0000 (17:04 +0200)]
fileops: replace integer usage with more explicit enum in some git_futils_rmdir_r() calls

12 years agorepository: ensure git_repository_open() returns ENOTFOUND when being passed a path...
nulltoken [Mon, 7 May 2012 14:16:08 +0000 (16:16 +0200)]
repository: ensure git_repository_open() returns ENOTFOUND when being passed a path leading to no repository

12 years agocompat: make p_realpath Windows implementation be a bit more POSIX compliant and...
nulltoken [Mon, 7 May 2012 11:58:01 +0000 (13:58 +0200)]
compat: make p_realpath Windows implementation be a bit more POSIX compliant and fail if the provided path does not lead to an existing entry

12 years agopath: Make git_path_prettify() properly handle ENOTDIR errno value
nulltoken [Mon, 7 May 2012 11:56:42 +0000 (13:56 +0200)]
path: Make git_path_prettify() properly handle ENOTDIR errno value

12 years agoobject: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing...
nulltoken [Mon, 7 May 2012 13:42:13 +0000 (15:42 +0200)]
object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type

12 years agoremote: make git_remote_load() return GIT_ENOTFOUND when the remote url cannot be...
nulltoken [Mon, 7 May 2012 08:57:34 +0000 (10:57 +0200)]
remote: make git_remote_load() return GIT_ENOTFOUND when the remote url cannot be retrieved from the config file

12 years agoremote: ensure the allocated remote is freed when an error occurs during its loading
nulltoken [Mon, 7 May 2012 08:04:50 +0000 (10:04 +0200)]
remote: ensure the allocated remote is freed when an error occurs during its loading

12 years agoMerge pull request #672 from scottjg/more-mingw32-fixes
Vicent Martí [Mon, 7 May 2012 20:36:02 +0000 (13:36 -0700)]
Merge pull request #672 from scottjg/more-mingw32-fixes

More mingw32 compilation fixes.

12 years agoFix directory finding for attrs
Russell Belfer [Mon, 7 May 2012 20:30:27 +0000 (13:30 -0700)]
Fix directory finding for attrs

The fix to support attrs on bare repos went a little too far
in trying to avoid using the working directory and ended up
not processing the input path quite correctly.

12 years agoMerge pull request #667 from nulltoken/fix/p_open
Russell Belfer [Mon, 7 May 2012 17:20:49 +0000 (10:20 -0700)]
Merge pull request #667 from nulltoken/fix/p_open

compat: make p_open able to accept optional mode when passing the O_CREAT flag

12 years agotravis: run the tests verbosely
Carlos Martín Nieto [Mon, 7 May 2012 10:31:31 +0000 (12:31 +0200)]
travis: run the tests verbosely

12 years agocompat: make p_open able to accept optional mode when passing the O_CREAT flag
nulltoken [Sun, 6 May 2012 11:04:12 +0000 (13:04 +0200)]
compat: make p_open able to accept optional mode when passing the O_CREAT flag

This has the nice side effect of making test_attr_repo__staging_properly_normalizes_line_endings_according_to_gitattributes_directives() test pass again on Windows. This test started to fail after commit 674a198 was applied.

12 years agoclar helper: don't dereference giterr_last() if it's NULL
Carlos Martín Nieto [Mon, 7 May 2012 09:28:26 +0000 (11:28 +0200)]
clar helper: don't dereference giterr_last() if it's NULL

It can cause segfaults if the call didn't set an error

12 years agoDefine explicit _WIN32_WINNT version in makefile
Scott J. Goldman [Mon, 7 May 2012 07:05:02 +0000 (00:05 -0700)]
Define explicit _WIN32_WINNT version in makefile

Previously, it was defined in netops.c, but it's also needed in one of the
clar tests, so I figured we might as well just make it global for the
whole project.

Without it, the mingw32 linker won't resolve GetProcessId() (called from
the core/errors.c clar test) because of some conditionals in windows.h.

12 years agoUpdate clar to latest version
Scott J. Goldman [Mon, 7 May 2012 06:58:41 +0000 (23:58 -0700)]
Update clar to latest version

Fixes the mingw32 build issues.

12 years agotransport git: don't use 'error' uninitialized
Carlos Martín Nieto [Sun, 6 May 2012 11:17:25 +0000 (13:17 +0200)]
transport git: don't use 'error' uninitialized

12 years agocompat: Add `stdarg.h` include
Vicent Martí [Sun, 6 May 2012 05:14:02 +0000 (22:14 -0700)]
compat: Add `stdarg.h` include

12 years agoMerge remote-tracking branch 'scottjg/fix-mingw32' into development
Vicent Martí [Sat, 5 May 2012 23:47:20 +0000 (16:47 -0700)]
Merge remote-tracking branch 'scottjg/fix-mingw32' into development

Conflicts:
src/netops.c
src/netops.h
src/transports/http.c
tests-clar/clar

12 years agoMerge pull request #659 from libgit2/development-merge
Vicent Martí [Sat, 5 May 2012 21:22:53 +0000 (14:22 -0700)]
Merge pull request #659 from libgit2/development-merge

New-error-handling

12 years agoMerge pull request #664 from arrbee/attrs-from-index
Vicent Martí [Sat, 5 May 2012 21:22:06 +0000 (14:22 -0700)]
Merge pull request #664 from arrbee/attrs-from-index

Support git attrs from index (and bare repo)

12 years agonotes: Cleanup error handling
Vicent Martí [Sat, 5 May 2012 21:18:10 +0000 (14:18 -0700)]
notes: Cleanup error handling

12 years agoMerge pull request #663 from schu/notes-honor-config
Vicent Martí [Sat, 5 May 2012 21:14:58 +0000 (14:14 -0700)]
Merge pull request #663 from schu/notes-honor-config

Honor core.notesRef config option

12 years agoFix unsigned/signed comparison on Windows in commitstagedfile.c
Scott J. Goldman [Sat, 5 May 2012 20:54:33 +0000 (13:54 -0700)]
Fix unsigned/signed comparison on Windows in commitstagedfile.c

12 years agoFix missing prototype warning in utf-conv.c
Scott J. Goldman [Sat, 5 May 2012 20:52:48 +0000 (13:52 -0700)]
Fix missing prototype warning in utf-conv.c

12 years agoFix gitno_connect() error handling on Windows
Scott J. Goldman [Sat, 5 May 2012 20:30:33 +0000 (13:30 -0700)]
Fix gitno_connect() error handling on Windows

gitno_connect() can return an error or socket, which is fine on most
platforms where sockets are file descriptors (signed int), but on Windows,
SOCKET is an unsigned type, which is problematic when we are trying to
test if the socket was actually a negative error code.

This fix seperates the error code and socket in gitno_connect(), and fixes
the error handling in do_connect() functions to compensate. It appears
that git_connect() and the git-transport do_connect() functions had bugs
in the non-windows cases too (leaking sockets, and not properly reporting
connection error, respectively) so I went ahead and fixed those too.

12 years agoFix clar generated code to compile on MINGW32
Scott J. Goldman [Sat, 5 May 2012 20:16:48 +0000 (13:16 -0700)]
Fix clar generated code to compile on MINGW32

MINGW32 does not define _mktemp_s, so we can just use _mktemp instead. See
the non-compressed/non-base64-encoded version of the patch here:
http://gist.github.com/2605249

12 years agoFix valgrind issues
Russell Belfer [Fri, 4 May 2012 23:46:46 +0000 (16:46 -0700)]
Fix valgrind issues

There are three changes here:
- correctly propogate error code from failed object lookups
- make zlib inflate use our allocators
- add OID to notfound error in ODB lookups

12 years agoclar: Properly create files in helper
Vicent Martí [Fri, 4 May 2012 23:05:14 +0000 (16:05 -0700)]
clar: Properly create files in helper

12 years agoFixing issue with test data
Russell Belfer [Fri, 4 May 2012 20:55:07 +0000 (13:55 -0700)]
Fixing issue with test data

12 years agocompat: va_copy on Win32 systems
Vicent Martí [Fri, 4 May 2012 20:52:38 +0000 (13:52 -0700)]
compat: va_copy on Win32 systems

12 years agoFix memory leaks and use after free
Russell Belfer [Fri, 4 May 2012 18:06:12 +0000 (11:06 -0700)]
Fix memory leaks and use after free

12 years agoSupport reading attributes from index
Russell Belfer [Thu, 3 May 2012 23:37:25 +0000 (16:37 -0700)]
Support reading attributes from index

Depending on the operation, we need to consider gitattributes
in both the work dir and the index.  This adds a parameter to
all of the gitattributes related functions that allows user
control of attribute reading behavior (i.e. prefer workdir,
prefer index, only use index).

This fix also covers allowing us to check attributes (and
hence do diff and status) on bare repositories.

This was a somewhat larger change that I hoped because it had
to change the cache key used for gitattributes files.

12 years agonotes: add git_note_default_ref()
Michael Schubert [Mon, 30 Apr 2012 12:29:34 +0000 (14:29 +0200)]
notes: add git_note_default_ref()

Add git_note_default_ref to allow easy retrieval of the currently set
default notes reference.

12 years agonotes: honor core.notesRef
Michael Schubert [Sun, 29 Apr 2012 16:42:42 +0000 (18:42 +0200)]
notes: honor core.notesRef

Setting core.notesRef allows to change the default notes reference used
by Git. Check if set before using GIT_NOTES_DEFAULT_REF. Fixes #649.

12 years agoSilence return value warning
Vicent Martí [Thu, 3 May 2012 20:30:14 +0000 (13:30 -0700)]
Silence return value warning

12 years agoerrors: Use a git_buf for building error strings
Vicent Martí [Thu, 3 May 2012 07:04:04 +0000 (00:04 -0700)]
errors: Use a git_buf for building error strings

12 years agobuffer: Add `git_buf_vprintf`
Vicent Martí [Thu, 3 May 2012 06:44:22 +0000 (23:44 -0700)]
buffer: Add `git_buf_vprintf`

12 years agoRemove old and unused error codes
Vicent Martí [Thu, 3 May 2012 02:56:38 +0000 (19:56 -0700)]
Remove old and unused error codes

12 years agoBoom
Vicent Martí [Wed, 2 May 2012 23:57:16 +0000 (16:57 -0700)]
Boom

12 years agochmod for writability when writing test files
Russell Belfer [Wed, 2 May 2012 23:44:47 +0000 (16:44 -0700)]
chmod for writability when writing test files

12 years agoBackport more test data
Vicent Martí [Wed, 2 May 2012 23:33:26 +0000 (16:33 -0700)]
Backport more test data

12 years agoMove test resources
Vicent Martí [Wed, 2 May 2012 23:18:55 +0000 (16:18 -0700)]
Move test resources

12 years agoUpdate test suite
Vicent Martí [Wed, 2 May 2012 23:14:30 +0000 (16:14 -0700)]
Update test suite

12 years agoMerge branch 'new-error-handling' into development
Vicent Martí [Wed, 2 May 2012 22:59:02 +0000 (15:59 -0700)]
Merge branch 'new-error-handling' into development

Conflicts:
.travis.yml
include/git2/diff.h
src/config_file.c
src/diff.c
src/diff_output.c
src/mwindow.c
src/path.c
tests-clar/clar_helpers.c
tests-clar/object/tree/frompath.c
tests/t00-core.c
tests/t03-objwrite.c
tests/t08-tag.c
tests/t10-refs.c
tests/t12-repo.c
tests/t18-status.c
tests/test_helpers.c
tests/test_main.c

12 years agoConvert from strnlen to git_text_is_binary
Russell Belfer [Mon, 5 Mar 2012 17:30:17 +0000 (09:30 -0800)]
Convert from strnlen to git_text_is_binary

Since strnlen is not supported on all platforms and since we
now have the shiny new git_text_is_binary in the filtering
code, let's convert diff binary detection to use the new stuff.

12 years agoCopy values to avoid strict aliasing warning
Russell Belfer [Mon, 5 Mar 2012 17:14:56 +0000 (09:14 -0800)]
Copy values to avoid strict aliasing warning

To make this code more resilient to future changes, we'll
explicitly translate the libgit2 structure to the libxdiff
structure.

12 years agoFix usage of "new" for fieldname in public header
Russell Belfer [Mon, 5 Mar 2012 07:28:36 +0000 (23:28 -0800)]
Fix usage of "new" for fieldname in public header

This should restore the ability to include libgit2 headers
in C++ projects.

Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from
development into new-error-handling.

12 years agoMerge remote-tracking branch 'carlosmn/remaining-errors' into new-error-handling
Vicent Martí [Wed, 2 May 2012 02:16:14 +0000 (19:16 -0700)]
Merge remote-tracking branch 'carlosmn/remaining-errors' into new-error-handling

Conflicts:
src/refspec.c

12 years agoMerge pull request #658 from schu/remote-disconnect
Vicent Martí [Wed, 2 May 2012 00:55:22 +0000 (17:55 -0700)]
Merge pull request #658 from schu/remote-disconnect

remote: don't free transport on disconnect

12 years agoremote: don't free transport on disconnect
Michael Schubert [Tue, 1 May 2012 20:25:43 +0000 (22:25 +0200)]
remote: don't free transport on disconnect

Currently, git_remote_disconnect not only closes the connection but also
frees the underlying transport object, making it impossible to write
code like

// fetch stuff
git_remote_download()

// close connection
git_remote_disconnect()

// call user provided callback for each ref
git_remote_update_tips(remote, callback)

because remote->refs points to references owned by the transport object.
This means, we have an idling connection while running the callback for
each reference.

Instead, allow immediate disconnect and free the transport later in
git_remote_free().

12 years agotests-clar/diff: mark output_len unused
Michael Schubert [Tue, 1 May 2012 12:28:18 +0000 (14:28 +0200)]
tests-clar/diff: mark output_len unused

12 years agoMerge pull request #655 from nulltoken/topic/cr-normalization-test
Vicent Martí [Mon, 30 Apr 2012 22:57:20 +0000 (15:57 -0700)]
Merge pull request #655 from nulltoken/topic/cr-normalization-test

crlf normalization test coverage

12 years agoattr: add test coverage related to crlf normalization while staging
nulltoken [Mon, 30 Apr 2012 22:33:25 +0000 (00:33 +0200)]
attr: add test coverage related to crlf normalization while staging

12 years agoMerge pull request #654 from carlosmn/pkt-err
Vicent Martí [Mon, 30 Apr 2012 21:38:15 +0000 (14:38 -0700)]
Merge pull request #654 from carlosmn/pkt-err

Recognize and report server-side error messages

12 years agoMerge pull request #652 from nulltoken/topic/diff-callbacks
Russell Belfer [Mon, 30 Apr 2012 20:32:09 +0000 (13:32 -0700)]
Merge pull request #652 from nulltoken/topic/diff-callbacks

diff: provide more context to the consumer of the callbacks

12 years agonet: recognize and report server-side error messages
Carlos Martín Nieto [Mon, 30 Apr 2012 15:44:37 +0000 (17:44 +0200)]
net: recognize and report server-side error messages

When e.g. a repository isn't found, the server sends an error saying
so. Put that error message in our error buffer.

12 years agoLeverage GIT_UNUSED macro to explicitly mark a function parameter as purposely unused
nulltoken [Mon, 30 Apr 2012 05:41:33 +0000 (07:41 +0200)]
Leverage GIT_UNUSED macro to explicitly mark a function parameter as purposely unused

12 years agobuf: deploy git_buf_len()
nulltoken [Sun, 29 Apr 2012 19:46:33 +0000 (21:46 +0200)]
buf: deploy git_buf_len()

12 years agodiff: provide more context to the consumer of the callbacks
nulltoken [Sun, 29 Apr 2012 17:42:51 +0000 (19:42 +0200)]
diff: provide more context to the consumer of the callbacks

Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.

12 years agobuf: add git_buf_len() accessor to expose the current length of the buffer content
nulltoken [Sun, 29 Apr 2012 17:08:48 +0000 (19:08 +0200)]
buf: add git_buf_len() accessor to expose the current length of the buffer content

12 years agoAdd a travis config file
Carlos Martín Nieto [Sat, 28 Apr 2012 23:38:36 +0000 (01:38 +0200)]
Add a travis config file

Teach travis how to build the project.

12 years agopkt: bring back GIT_ESHORTBUFFER
Carlos Martín Nieto [Sat, 28 Apr 2012 23:20:02 +0000 (01:20 +0200)]
pkt: bring back GIT_ESHORTBUFFER

The recent 64-bit Windows fixes changed the return code in
git_pkt_parse_line() so it wouldn't signal a short buffer, breaking
the network code. Bring it back.

12 years agoremote: add more doc on git_remote_free
Michael Schubert [Sat, 28 Apr 2012 18:49:05 +0000 (20:49 +0200)]
remote: add more doc on git_remote_free

12 years agorefs: fix unused-but-set warning
Michael Schubert [Fri, 27 Apr 2012 16:04:58 +0000 (18:04 +0200)]
refs: fix unused-but-set warning

12 years agoFix Win32 warnings
Russell Belfer [Thu, 26 Apr 2012 20:04:54 +0000 (13:04 -0700)]
Fix Win32 warnings

12 years agoMerge pull request #646 from arrbee/ignore-pat-leading-slash
Vicent Martí [Thu, 26 Apr 2012 19:08:43 +0000 (12:08 -0700)]
Merge pull request #646 from arrbee/ignore-pat-leading-slash

Ignore pat leading slash

12 years agoFix leading slash behavior in attrs/ignores
Russell Belfer [Thu, 26 Apr 2012 17:51:45 +0000 (10:51 -0700)]
Fix leading slash behavior in attrs/ignores

We were not following the git behavior for leading slashes
in path names when matching git ignores and git attribute
file patterns.  This should fix issue #638.

12 years agoerror handling: move the missing parts over to the new error handling
Carlos Martín Nieto [Thu, 26 Apr 2012 13:05:07 +0000 (15:05 +0200)]
error handling: move the missing parts over to the new error handling

12 years agodiff: fix generation of the header of a removal patch
nulltoken [Wed, 25 Apr 2012 20:23:35 +0000 (22:23 +0200)]
diff: fix generation of the header of a removal patch

12 years agoMerge pull request #642 from arrbee/mem-pools
Russell Belfer [Wed, 25 Apr 2012 22:24:05 +0000 (15:24 -0700)]
Merge pull request #642 from arrbee/mem-pools

Memory pools and khash hashtables

12 years agoRename git_khash_str to git_strmap, etc.
Russell Belfer [Wed, 25 Apr 2012 22:20:28 +0000 (15:20 -0700)]
Rename git_khash_str to git_strmap, etc.

This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
`git_oidmap`, and deletes `git_hashtable` from the tree, plus
adds unit tests for `git_strmap`.

12 years agoMerge pull request #641 from carlosmn/networking
Vicent Martí [Wed, 25 Apr 2012 21:29:45 +0000 (14:29 -0700)]
Merge pull request #641 from carlosmn/networking

More Networking updates

12 years agoInclude the new config test file
Carlos Martín Nieto [Wed, 25 Apr 2012 18:42:33 +0000 (20:42 +0200)]
Include the new config test file

12 years agoConvert hashtable usage over to khash
Russell Belfer [Wed, 25 Apr 2012 17:36:01 +0000 (10:36 -0700)]
Convert hashtable usage over to khash

This updates khash.h with some extra features (like error checking
on allocations, ability to use wrapped malloc, foreach calls, etc),
creates two high-level wrappers around khash: `git_khash_str` and
`git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
then converts all of the old usage of `git_hashtable` over to use
these new hashtables.

For `git_khash_str`, I've tried to create a set of macros that
yield an API not too unlike the old `git_hashtable` API.  Since
the oid hashtable is only used in one file, I haven't bother to
set up all those macros and just use the khash APIs directly for
now.

12 years agoImport khash.h from attractivechaos/klib
Russell Belfer [Tue, 24 Apr 2012 18:02:40 +0000 (11:02 -0700)]
Import khash.h from attractivechaos/klib

12 years agoAdding stash to hashtable implementation
Russell Belfer [Mon, 23 Apr 2012 16:23:58 +0000 (09:23 -0700)]
Adding stash to hashtable implementation

Adding a small stash of nodes with key conflicts has been
demonstrated to greatly increase the efficiency of a cuckoo
hashtable.  See:

  http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf

for more details.

12 years agoMoving power-of-two bit utilities into util.h
Russell Belfer [Mon, 23 Apr 2012 16:21:15 +0000 (09:21 -0700)]
Moving power-of-two bit utilities into util.h

12 years agoConvert revwalk to use git_pool
Russell Belfer [Wed, 18 Apr 2012 17:57:08 +0000 (10:57 -0700)]
Convert revwalk to use git_pool

This removes the custom paged allocator from revwalk and
replaces it with a `git_pool`.

12 years agoConvert attrs and diffs to use string pools
Russell Belfer [Tue, 17 Apr 2012 22:12:50 +0000 (15:12 -0700)]
Convert attrs and diffs to use string pools

This converts the git attr related code (including ignores) and
the git diff related code (and implicitly the status code) to use
`git_pools` for storing strings.  This reduces the number of small
blocks allocated dramatically.

12 years agoImplement git_pool paged memory allocator
Russell Belfer [Tue, 17 Apr 2012 17:14:24 +0000 (10:14 -0700)]
Implement git_pool paged memory allocator

This adds a `git_pool` object that can do simple paged memory
allocation with free for the entire pool at once.  Using this,
you can replace many small allocations with large blocks that
can then cheaply be doled out in small pieces.  This is best
used when you plan to free the small blocks all at once - for
example, if they represent the parsed state from a file or data
stream that are either all kept or all discarded.

There are two real patterns of usage for `git_pools`: either
for "string" allocation, where the item size is a single byte
and you end up just packing the allocations in together, or for
"fixed size" allocation where you are allocating a large object
(e.g. a `git_oid`) and you generally just allocation single
objects that can be tightly packed.  Of course, you can use it
for other things, but those two cases are the easiest.

12 years agoconfig: also allow escaping outside of a quoted string
Carlos Martín Nieto [Wed, 25 Apr 2012 13:47:53 +0000 (15:47 +0200)]
config: also allow escaping outside of a quoted string

This limitation was a misparsing of the documentation.

12 years agoremote: run a callback when updating the branch tips
Carlos Martín Nieto [Wed, 25 Apr 2012 10:13:20 +0000 (12:13 +0200)]
remote: run a callback when updating the branch tips

This allows the caller to update an internal structure or update the
user output with the tips that were updated.

While in the area, only try to update the ref if the value is
different from its old one.

12 years agorevwalk: return GIT_EREVWALKER earlier if no references were pushed
Carlos Martín Nieto [Mon, 16 Apr 2012 09:58:46 +0000 (11:58 +0200)]
revwalk: return GIT_EREVWALKER earlier if no references were pushed

In the case that walk->one is NULL, we know that we have no positive
references, so we already know that the revwalk is over.

12 years agoexamples: run fetch in a background thread
Carlos Martín Nieto [Mon, 16 Apr 2012 03:02:41 +0000 (05:02 +0200)]
examples: run fetch in a background thread

This allows us to give updates on how it's doing

12 years agotransports: buffer the git requests before sending them
Carlos Martín Nieto [Sat, 14 Apr 2012 16:34:50 +0000 (18:34 +0200)]
transports: buffer the git requests before sending them

Trying to send every single line immediately won't give us any speed
improvement and duplicates the code we need for other transports. Make
the git transport use the same buffer functions as HTTP.

12 years agoexamples: port 'fetch' to the new API
Carlos Martín Nieto [Fri, 13 Apr 2012 21:37:55 +0000 (23:37 +0200)]
examples: port 'fetch' to the new API

12 years agofetch: use the streaming indexer when downloading a pack
Carlos Martín Nieto [Fri, 13 Apr 2012 21:19:38 +0000 (23:19 +0200)]
fetch: use the streaming indexer when downloading a pack

This changes the git_remote_download() API, but the existing one is
silly, so you don't get to complain.

The new API allows to know how much data has been downloaded, how many
objects we expect in total and how many we've processed.

12 years agoMerge pull request #632 from arrbee/win64-cleanup
Vicent Martí [Tue, 24 Apr 2012 00:28:11 +0000 (17:28 -0700)]
Merge pull request #632 from arrbee/win64-cleanup

Code clean up, including fixing warnings on Windows 64-bit build

12 years agoMerge pull request #637 from nulltoken/issue/odb-refcount
Vicent Martí [Tue, 24 Apr 2012 00:25:11 +0000 (17:25 -0700)]
Merge pull request #637 from nulltoken/issue/odb-refcount

Fix git_repository_set_odb() refcount issue

12 years agotree-cache: don't error out on a childless invalidated entry
Carlos Martín Nieto [Fri, 20 Apr 2012 00:23:14 +0000 (02:23 +0200)]
tree-cache: don't error out on a childless invalidated entry

The code used to assume that there had to be data after the newline in
a tree cache extension entry. This isn't true for a childless
invalidated entry if it's the last one, as there won't be any children
nor a hash to take up space.

Adapt the off-by-one comparison to also work in this case. Fixes #633.

12 years agoRename to git_reference_name_to_oid
Russell Belfer [Mon, 23 Apr 2012 17:06:31 +0000 (10:06 -0700)]
Rename to git_reference_name_to_oid

12 years agoFix git_repository_set_odb() refcount issue
nulltoken [Mon, 23 Apr 2012 09:07:19 +0000 (11:07 +0200)]
Fix git_repository_set_odb() refcount issue

git_repository_free() calls git_odb_free() if the owned odb is not null.

According to the doc, when setting a new odb through git_repository_set_odb() the caller has to take care of releasing the odb by himself.

12 years agoMerge pull request #636 from csware/WIN32-fixes
Vicent Martí [Sun, 22 Apr 2012 18:34:12 +0000 (11:34 -0700)]
Merge pull request #636 from csware/WIN32-fixes

Win32 fixes