Commit Graph

8670 Commits

Author SHA1 Message Date
Carlos Martín Nieto
d4723c89d4 Merge pull request #3177 from ethomson/binary_diff
Binary diffs: store deltas in the diff structure, include binary data in diff callbacks
2015-06-15 08:17:45 +02:00
Carlos Martín Nieto
ae22ef0e5a Merge pull request #3217 from jeffhostetler/leak_checkout_icase
Fix leaks in tests/checkout/icase
2015-06-15 08:09:21 +02:00
Carlos Martín Nieto
f2dec48118 Merge pull request #3215 from jeffhostetler/windows_leak_diriter
Fix memory leak on windows in diriter.
2015-06-12 18:35:18 +02:00
Jeff Hostetler
26d5c0b823 Fix leaks in tests/checkout/icase 2015-06-12 09:28:47 -07:00
Damien PROFETA
5c757327fa Fix visibility of transaction symbol
Transaction.c did not include the visibility definition of its symbol
(that are in git2/transaction.h) and so was by default hidden.
2015-06-12 18:14:32 +02:00
Jeff Hostetler
95639dbb9b Fix memory leak on windows in diriter. 2015-06-12 08:50:48 -07:00
Edward Thomson
0e522f6e6a binary diff: document changes in CHANGELOG 2015-06-12 09:39:37 -04:00
Edward Thomson
3208df37fb patch: include diff options on blob->blob diffs 2015-06-12 09:39:33 -04:00
Edward Thomson
391281ae34 binary diff: test binary blob to blob tests 2015-06-12 09:39:29 -04:00
Edward Thomson
8147b1aff5 diff: introduce binary diff callbacks
Introduce a new binary diff callback to provide the actual binary
delta contents to callers.  Create this data from the diff contents
(instead of directly from the ODB) to support binary diffs including
the workdir, not just things coming out of the ODB.
2015-06-12 09:39:20 -04:00
Edward Thomson
ac7012a81f binary diff: test index->workdir binary diffs 2015-06-12 09:24:59 -04:00
Carlos Martín Nieto
6995b18ad2 Merge pull request #3208 from git-up/secure_transport
Fixed some Secure Transport issues on OS X
2015-06-12 14:52:48 +02:00
Carlos Martín Nieto
4ce58244a2 Merge pull request #3214 from libgit2/cmn/push-tests
travis: fail if we fail the push tests
2015-06-12 14:51:59 +02:00
Carlos Martín Nieto
352ee17152 clone: set the credentials callback during testing 2015-06-12 12:45:49 +02:00
Carlos Martín Nieto
0f69b41d2e push: pass the callbacks during setup as well
We need to pass these options in order to have the credentials callback
set.
2015-06-12 12:33:55 +02:00
Carlos Martín Nieto
6042a050f9 travis: fail if we fail the push tests
These tests were not being taken into consideration for the failure of
the test. They've been failing for a while now, but we hadn't noticed as
Travis was reporting the builds successful.
2015-06-12 12:17:03 +02:00
Pierre-Olivier Latour
6d0a0acafa Fixed some Secure Transport issues on OS X
The read and write callbacks passed to SSLSetIOFuncs() have been
rewritten to match the implementation used on opensource.apple.com and
other open source projects like VLC.

This change also fixes a bug where the read callback could get into
an infinite loop when 0 bytes were read.
2015-06-11 23:20:28 -07:00
Carlos Martín Nieto
2deb36081c Merge pull request #3155 from mgorny/userpass-const
cred_helpers: Add 'const' qualifiers to git_cred_userpass_payload
2015-06-11 08:54:48 +02:00
Carlos Martín Nieto
65d69fe854 commit: ignore multiple author fields
Some tools create multiple author fields. git is rather lax when parsing
them, although fsck does complain about them. This means that they exist
in the wild.

As it's not too taxing to check for them, and there shouldn't be a
noticeable slowdown when dealing with correct commits, add logic to skip
over these extra fields when parsing the commit.
2015-06-11 08:24:58 +02:00
Carlos Martín Nieto
fa934fabf7 Merge pull request #3205 from ethomson/crlf_query
Introduce `git_filter_list_contains`
2015-06-11 07:17:34 +02:00
Carlos Martín Nieto
3fcfede184 Merge pull request #3207 from ethomson/winhttp_eol
Correct line endings on winhttp.def
2015-06-11 07:13:07 +02:00
Edward Thomson
3e8c5e45cb Merge pull request #3174 from libgit2/cmn/idx-fill-hole
indexer: use lseek to extend the packfile
2015-06-10 16:43:48 -04:00
Edward Thomson
7f8cd672a1 Merge pull request #3204 from git-up/git_diff_find_similar
Fixed handling of GIT_DELTA_CONFLICTED  in git_diff_find_similar()
2015-06-10 16:42:07 -04:00
Edward Thomson
4f0f2b8473 Correct line endings on winhttp.def 2015-06-10 16:36:38 -04:00
Edward Thomson
2eecc2886b Introduce git_filter_list_contains
`git_filter_list_contains` can be used to query a filter list to
determine if a given filter will be run.
2015-06-10 14:43:49 -04:00
Carlos Martín Nieto
4e883b5ec7 Merge pull request #3203 from ethomson/gitattributes
gitattributes: let clients use native line endings
2015-06-10 19:55:18 +02:00
Pierre-Olivier Latour
50456801c0 Fixed handling of GIT_DELTA_CONFLICTED in git_diff_find_similar()
git_diff_find_similar() now ignores git_diff_delta records with a status
of GIT_DELTA_CONFLICTED, which fixes a crash due to assert() being hit.
2015-06-10 10:09:10 -07:00
Edward Thomson
f284e72946 gitattributes: let clients use native line endings
Use "text=auto" to ensure that we get LFs in the repository, but
let clients have their native line endings in their worktree.
2015-06-10 12:24:06 -04:00
Edward Thomson
da6720fcc5 Merge pull request #3201 from libgit2/cmn/coverity
A few more fixes from coverity
2015-06-10 09:02:54 -04:00
Carlos Martín Nieto
0137aba568 filter: close the descriptor in case of error
When we hit an error writing to the next stream from a file, we jump to
'done' which currently skips over closing the file descriptor.

Make sure to close the descriptor if it has been set to a valid value.
2015-06-10 11:08:05 +02:00
Carlos Martín Nieto
969d4b703c object: correct the expected ID size in prefix lookup
We take in a possibly partial ID by taking a length and working off of
that to figure out whether to just look up the object or ask the
backends for a prefix lookup.

Unfortunately we've been checking the size against `GIT_OID_HEXSZ` which
is the size of a *string* containing a full ID, whereas we need to check
against the size we can have when it's a 20-byte array.

Change the checks and comment to use `GIT_OID_RAWSZ` which is the
correct size of a git_oid to have when full.
2015-06-10 10:59:56 +02:00
Carlos Martín Nieto
878293f7e1 pack: use git_buf when building the index name
The way we currently do it depends on the subtlety of strlen vs sizeof
and the fact that .pack is one longer than .idx. Let's use a git_buf so
we can express the manipulation we want much more clearly.
2015-06-10 10:44:14 +02:00
Carlos Martín Nieto
ca2857d81b merge: actually increment the counts, not the pointers
`merge_diff_list_count_candidates()` takes pointers to the source and
target counts, but when it comes time to increase them, we're increasing
the pointer, rather than the value it's pointing to.

Dereference the value to increase.
2015-06-10 10:30:08 +02:00
Carlos Martín Nieto
2d73075a41 cache: add a check for a failed allocation
Rather minimal change, but it's the kind of thing we should do.
2015-06-10 10:23:08 +02:00
Edward Thomson
a166466cd1 Merge pull request #3198 from libgit2/cmn/coverity
A few fixes from Coverity
2015-06-09 17:06:28 -04:00
Carlos Martín Nieto
02980bdca1 Initialize a few variables
Coverity complains about the git_rawobj ones because we use a loop in
which we keep remembering the old version, and we end up copying our
object as the base, so we want to have the data pointer be NULL.
2015-06-09 16:53:07 +02:00
Carlos Martín Nieto
81be2f467c ssh: move NULL check to the free function
Let `ssh_stream_free()` take a NULL stream, as free functions should,
and remove the check from the connection setup.

The connection setup would not need the check anyhow, as we always have
a stream by the time we reach this code.
2015-06-09 16:01:29 +02:00
Carlos Martín Nieto
82a7a24cf4 Merge pull request #3165 from ethomson/downcase
Downcase
2015-06-08 15:22:01 +02:00
Carlos Martín Nieto
c0d7999263 Merge pull request #3188 from thentenaar/clean-up-after-openssl
global: Ensure we free our SSL context.
2015-06-08 12:21:36 +02:00
Tim Hentenaar
20f8edb7a5 global: Ensure we free our SSL context. 2015-06-08 09:38:50 +02:00
Carlos Martín Nieto
b6011e296e Merge pull request #3185 from libgit2/cmn/foreach-cancel-loose
path: error out if the callback returns an error
2015-06-07 15:10:28 +02:00
Carlos Martín Nieto
fdb82dcd58 Merge pull request #3175 from git-up/build_warnings
Fixed build warnings on Xcode 6.1
2015-06-07 15:10:13 +02:00
Carlos Martín Nieto
2785544fb5 remote: some error-handling issues from Coverity 2015-06-07 10:45:39 +02:00
Carlos Martín Nieto
3c4442a2aa Merge pull request #3179 from arielb2/master
print_usage functions is defined but not used
2015-06-07 10:03:31 +02:00
Carlos Martín Nieto
8da4404705 path: error out if the callback returns an error
When the callback returns an error, we should stop immediately. This
broke when trying to make sure we pass specific errors up the chain.

This broke cancelling out of the loose backend's foreach.
2015-06-06 03:55:28 +02:00
Carlos Martín Nieto
babdc376c7 Merge pull request #3172 from Therzok/patch-2
Change error when running out of ssh agent keys
2015-06-04 13:02:59 +02:00
Ariel O. Barria
9334c86f49 print_usage functions is defined but not used
Use the previously created function to display a message when the arguments are not valid.

ticket 3095
2015-06-03 14:54:35 -05:00
Pierre-Olivier Latour
9f3c18e2ac Fixed build warnings on Xcode 6.1 2015-06-02 11:49:38 -07:00
Marius Ungureanu
d71e3b2532 Change error when running out of ssh agent keys 2015-06-02 12:32:19 +03:00
Carlos Martín Nieto
aa57231fca indexer: use lseek to extend the packfile
We've been using `p_ftruncate()` to extend the packfile in order to mmap
it and write the new data into it. This works well in the general case,
but as truncation does not allocate space in the filesystem, it must do
so when we write data to it.

The only way the OS has to indicate a failure to allocate space is via
SIGBUS which means we tried to write outside the file. This will cause
everyone to crash as they don't expect to handle this signal.

Switch to using `p_lseek()` and `p_write()` to extend the file in a way
which tells the filesystem to allocate the space for the missing
data. We can then be sure that we have space to write into.
2015-06-02 10:25:22 +02:00