Commit Graph

8307 Commits

Author SHA1 Message Date
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
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
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
Carlos Martín Nieto
be5fda7587 Include git2/transaction.h
This was forgotten when the feature was implemented.
2015-05-31 19:22:12 +02:00
Carlos Martín Nieto
449f9ec97e Merge pull request #3152 from tkelman/patch-1
build maint branches on appveyor
2015-05-31 18:53:42 +02:00
Carlos Martín Nieto
ac587e7596 Merge pull request #3048 from pks-t/insteadof
Implementation of url.*.insteadOf
2015-05-31 15:45:56 +02:00
Patrick Steinhardt
9e88a823f6 remote: test insteadOf for anonymous remotes 2015-05-31 13:26:05 +02:00
Patrick Steinhardt
771069e1fb Add CHANGELOG entry for url.*.insteadOf feature. 2015-05-31 13:22:48 +02:00
Patrick Steinhardt
ec0c4c4001 remote: apply insteadOf configuration.
A remote's URLs are now modified according to the url.*.insteadOf
and url.*.pushInsteadOf configurations. This allows a user to
replace URL prefixes by setting the corresponding keys. E.g.
"url.foo.insteadOf = bar" would replace the prefix "bar" with the
new prefix "foo".
2015-05-31 13:21:53 +02:00
Edward Thomson
bad33a5dfb git__tolower: test that some non-ASCII downcasing isn't 2015-05-29 18:16:51 -04:00
Edward Thomson
75a4636f50 git__tolower: a tolower() that isn't dumb
Some brain damaged tolower() implementations appear to want to
take the locale into account, and this may require taking some
insanely aggressive lock on the locale and slowing down what should
be the most trivial of trivial calls for people who just want to
downcase ASCII.
2015-05-29 18:16:46 -04:00
Edward Thomson
006548da91 git__strcasecmp: treat input bytes as unsigned
Treat input bytes as unsigned before doing arithmetic on them,
lest we look at some non-ASCII byte (like a UTF-8 character) as a
negative value and perform the comparison incorrectly.
2015-05-29 16:07:51 -04:00
Carlos Martín Nieto
a5670d4f2d CHANGELOG: fill in a few missing entries 2015-05-29 20:09:46 +02:00
Carlos Martín Nieto
2c8550f040 Merge pull request #3157 from mgorny/ssh_memory_auth
Support getting SSH keys from memory, pt. 2
2015-05-29 19:38:11 +02:00