Commit Graph

6044 Commits

Author SHA1 Message Date
Vicent Marti
32309b5d82 Merge pull request #2034 from jacquesg/solaris-qsort
Solaris doesn't have qsort_r either
2014-01-08 04:09:09 -08:00
Jacques Germishuys
551f5cefb4 Solaris does not have qsort_r 2014-01-08 13:47:47 +02:00
XTao
a06474f81d Add orig_commit. 2014-01-08 11:19:12 +08:00
Vicent Marti
fe959e5273 Merge pull request #2023 from arthurschreiber/patch-1
Add missing `git_reference_symbolic_create_with_log`.
2014-01-07 09:58:05 -08:00
nulltoken
5ce9f9b425 Merge pull request #2030 from seejohnrun/patch-1
Fix spelling mistake
2014-01-04 15:22:20 -08:00
John Crepezzi
e7f89b46c3 Fix spelling mistake
Closes #2029
2014-01-04 18:18:59 -05:00
Russell Belfer
ac9f92316b Merge pull request #2022 from KTXSoftware/development
submodule branch option + little VS2013 fix
2014-01-03 14:40:25 -08:00
Vicent Marti
5f5e44652e Merge pull request #2026 from libgit2/rb/fix-strnlen-on-old-macos
Use our strnlen on MacOS for backward compat
2014-01-03 13:01:14 -08:00
Russell Belfer
b49985212a Use our strnlen on MacOS for backward compat
Apparently MacOS didn't have strnlen on 10.6 and earlier.  To
avoid having linking problems on older versions, we'll just use
our internal version.
2014-01-03 11:37:23 -08:00
Russell Belfer
9152417290 Fix warnings with submodule changes 2014-01-02 14:30:24 -08:00
Arthur Schreiber
0b7951788c Allow the log message to be NULL. 2014-01-02 16:58:13 +01:00
Arthur Schreiber
e5994eb02d Add missing git_reference_symbolic_create_with_log.
It's exported in the headers, but the implementation was missing.
2014-01-02 16:56:09 +01:00
Robert Konrad
1031197949 Read the submodule branch option from Git 1.8.2. 2014-01-02 15:10:32 +01:00
Robert Konrad
6014b7b59c Fixed a compile error in VS2013. 2014-01-02 15:10:32 +01:00
Vicent Marti
f3a302ad8e Merge pull request #2019 from linquize/recurse-on-demand
Accept 'submodule.*.fetchRecurseSubmodules' config 'on-demand' value
2014-01-02 05:10:04 -08:00
Vicent Marti
71223e1c4a Merge pull request #2020 from mrshu/patch-1
Updated fetch.c test to pass.
2014-01-02 05:09:36 -08:00
Marek Šuppa
f38cb9815f Updated fetch.c test to pass.
I am not sure why there was 6 in the first place.
2013-12-31 11:27:32 +01:00
Linquize
41ceab2522 Update test related to fetchRecurseSubmodules 2013-12-31 07:34:40 +08:00
Linquize
217fee9ae6 Default value for fetchRecurseSubmodules should be yes 2013-12-31 07:34:40 +08:00
Linquize
fccadba252 Accept 'submodule.*.fetchRecurseSubmodules' config 'on-demand' value 2013-12-31 07:34:39 +08:00
Russell Belfer
868563cc92 Merge pull request #2015 from txdv/patch-1
docs: Remove non existing wrapper from the readme
2013-12-30 11:41:16 -08:00
Andrius Bentkus
7b50c7845b docs: Remove non existing wrapper from the readme
libgit2net stopped to exist, all hail libgit2sharp
2013-12-27 15:15:48 +02:00
Vicent Marti
4e1f517c61 Merge pull request #1920 from libgit2/cmn/ref-with-log
Reference operations with log
2013-12-18 09:33:45 -08:00
Vicent Marti
a7ecd1a9e3 Merge pull request #2000 from ethomson/overwrite_ignored
Overwrite ignored files on checkout
2013-12-13 07:29:27 -08:00
Edward Thomson
bf4a577c69 Overwrite ignored directories on checkout 2013-12-13 10:10:32 -05:00
Edward Thomson
81a2012d99 Overwrite ignored files on checkout 2013-12-13 09:29:55 -05:00
Vicent Marti
79194bcdc9 Merge pull request #1986 from libgit2/rb/error-handling-cleanups
Clean up some error handling and change callback error behavior
2013-12-13 06:20:19 -08:00
Vicent Marti
7a16d54b54 pool: Agh, this test doesn't really apply in 32-bit machines
The size_t is 32-bit already, so it overflows before going into the
function. The `-1` test should handle this gracefully in both cases
anyway.
2013-12-13 12:47:51 +01:00
Vicent Marti
437f7d69b2 pool: Correct overflow checks
Ok, scrap the previous commit. This is the right overflow check that
takes care of 64 bit overflow **and** 32-bit overflow, which needs to be
considered because the pool malloc can only allocate 32-bit elements in
one go.
2013-12-13 12:41:22 +01:00
Vicent Marti
ce33645ff3 pool: Cleanup error handling in pool_strdup
Note that `git_pool_strdup` cannot really return any error codes,
 because the pool doesn't set errors on OOM.

 The only place where `giterr_set_oom` is called is in
 `git_pool_strndup`, in a conditional check that is always optimized
 away. `n + 1` cannot be zero if `n` is unsigned because the compiler
 doesn't take wraparound into account.

 This check has been removed altogether because `size_t` is not
 particularly going to overflow.
2013-12-13 12:25:48 +01:00
Russell Belfer
25a1fab0a9 Merge pull request #2001 from ethomson/merge_version_validate
Validate struct versions in merge, revert
2013-12-12 14:58:18 -08:00
Edward Thomson
86a05ef382 Validate struct versions in merge, revert 2013-12-12 17:40:40 -05:00
Russell Belfer
452c7de668 Add git_treebuilder_insert test and clarify doc
This wasn't being tested and since it has a callback, I fixed it
even though the return value of this callback is not treated like
any of the other callbacks in the API.
2013-12-12 14:16:40 -08:00
Russell Belfer
9cfce2735d Cleanups, renames, and leak fixes
This renames git_vector_free_all to the better git_vector_free_deep
and also contains a couple of memory leak fixes based on valgrind
checks.  The fixes are specifically: failure to free global dir
path variables when not compiled with threading on and failure to
free filters from the filter registry that had not be initialized
fully.
2013-12-12 12:11:38 -08:00
Russell Belfer
11bd7a034b More tests of canceling from callbacks
This covers diff print, push, and ref foreach.  This also has a
fix for a small memory leak in the push tests.
2013-12-12 11:14:51 -08:00
Russell Belfer
7e3ed41959 Fix up some valgrind leaks and warnings 2013-12-11 16:56:17 -08:00
Russell Belfer
7697e54176 Test cancel from indexer progress callback
This adds tests that try canceling an indexer operation from
within the progress callback.

After writing the tests, I wanted to run this under valgrind and
had a number of errors in that situation because mmap wasn't
working.  I added a CMake option to force emulation of mmap and
consolidated the Amiga-specific code into that new place (so we
don't actually need separate Amiga code now, just have to turn on
-DNO_MMAP).

Additionally, I made the indexer code propagate error codes more
reliably than it used to.
2013-12-11 15:02:20 -08:00
Russell Belfer
8b22d862fb More improvements to callback return value tests
This time actually checking return values in diff notify tests and
actually testing callbacks for the index all-all/update-all/etc
functions.
2013-12-11 11:55:00 -08:00
Russell Belfer
8046b26cb1 Try a test that won't assert on Linux 2013-12-11 10:57:51 -08:00
Russell Belfer
8f1066a05f Update clone doc and tests for callback return val
Clone callbacks can return non-zero values to cancel the clone.
This adds some tests to verify that this actually works and updates
the documentation to be clearer that this can happen and that the
return value will be propagated back by the clone function.
2013-12-11 10:57:51 -08:00
Russell Belfer
cbd048969e Fix checkout notify callback docs and tests
The checkout notify callback behavior on non-zero return values
was not being tested.  This adds tests, fixes a bug with positive
values, and clarifies the documentation to make it clear that the
checkout can be canceled via this mechanism.
2013-12-11 10:57:50 -08:00
Russell Belfer
19853bdd97 Update git_blob_create_fromchunks callback behavr
The callback to supply data chunks could return a negative value
to stop creation of the blob, but we were neither using GIT_EUSER
nor propagating the return value.  This makes things use the new
behavior of returning the negative value back to the user.
2013-12-11 10:57:50 -08:00
Russell Belfer
373cf6a932 Update docs for new callback return value behavior 2013-12-11 10:57:50 -08:00
Russell Belfer
26c1cb91be One more rename/cleanup for callback err functions 2013-12-11 10:57:50 -08:00
Russell Belfer
f10d7a368f Further callback error check style fixes
Okay, I've decided I like the readability of this style much
better so I used it everywhere.
2013-12-11 10:57:50 -08:00
Russell Belfer
c7b3e1b320 Some callback error check style cleanups
I find this easier to read...
2013-12-11 10:57:50 -08:00
Russell Belfer
60058018dc Fix C99 __func__ for MSVC 2013-12-11 10:57:50 -08:00
Russell Belfer
25e0b1576d Remove converting user error to GIT_EUSER
This changes the behavior of callbacks so that the callback error
code is not converted into GIT_EUSER and instead we propagate the
return value through to the caller.  Instead of using the
giterr_capture and giterr_restore functions, we now rely on all
functions to pass back the return value from a callback.

To avoid having a return value with no error message, the user
can call the public giterr_set_str or some such function to set
an error message.  There is a new helper 'giterr_set_callback'
that functions can invoke after making a callback which ensures
that some error message was set in case the callback did not set
one.

In places where the sign of the callback return value is
meaningful (e.g. positive to skip, negative to abort), only the
negative values are returned back to the caller, obviously, since
the other values allow for continuing the loop.

The hardest parts of this were in the checkout code where positive
return values were overloaded as meaningful values for checkout.
I fixed this by adding an output parameter to many of the internal
checkout functions and removing the overload.  This added some
code, but it is probably a better implementation.

There is some funkiness in the network code where user provided
callbacks could be returning a positive or a negative value and
we want to rely on that to cancel the loop.  There are still a
couple places where an user error might get turned into GIT_EUSER
there, I think, though none exercised by the tests.
2013-12-11 10:57:49 -08:00
Russell Belfer
fcd324c625 Add git_vector_free_all
There are a lot of places that we call git__free on each item in
a vector and then call git_vector_free on the vector itself.  This
just wraps that up into one convenient helper function.
2013-12-11 10:57:49 -08:00
Russell Belfer
dab89f9b68 Further EUSER and error propagation fixes
This continues auditing all the places where GIT_EUSER is being
returned and making sure to clear any existing error using the
new giterr_user_cancel helper.  As a result, places that relied
on intercepting GIT_EUSER but having the old error preserved also
needed to be cleaned up to correctly stash and then retrieve the
actual error.

Additionally, as I encountered places where error codes were not
being propagated correctly, I tried to fix them up.  A number of
those fixes are included in the this commit as well.
2013-12-11 10:57:49 -08:00