| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
A few fixes from Coverity
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
|/| |
Fixed build warnings on Xcode 6.1
|
| | |
|
|/ |
|
|
|
|
|
|
| |
The public key field is optional and as such can take NULL. Account for
that and do not call strlen() on NULL values. Also assert() for non-NULL
values of username & private key.
|
|
|
|
|
|
|
| |
Declare GIT_CREDTYPE_SSH_MEMORY to have consistent API independently of
whether libgit2 was built with or without in-memory key passing support.
Or rather, to have it at all since build-time definitions are not stored
in headers.
|
|
|
|
| |
To not modify the external api.
|
| |
|
|
|
|
|
|
| |
This can be used by tools to show mesages about failing to communicate
with the server. The error message in this case will often contain the
server's error message, as far as it managed to send anything.
|
|
|
|
|
|
|
|
| |
When we fail to read from stdout, it's typically because the URL was
wrong and the server process has sent some output over its stderr
output.
Read that output and set the error message to whatever we read from it.
|
| |
|
| |
|
|\
| |
| | |
Use the packbuilder in local push
|
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of copying each object individually, as we'd been doing, use the
packbuilder which should be faster and give us some feedback.
While performing this change, we can hook up the packbuilder's writing
to the push progress so the caller knows how far along we are.
|
| | |
|
|/
|
|
|
| |
Set a callback for the packbuilder so we can send the sideband messages
to the caller, formatting them as git would.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having the setting be different from calling its actions was not a great
idea and made for the sake of the wrong convenience.
Instead of that, accept either fetch options, push options or the
callbacks when dealing with the remote. The fetch options are currently
only the callbacks, but more options will be moved from setters and
getters on the remote to the options.
This does mean passing the same struct along the different functions but
the typical use-case will only call git_remote_fetch() or
git_remote_push() and so won't notice much difference.
|
|
|
|
|
|
|
|
|
| |
The push object knows which remote it's associated with, and therefore
does not need to keep its own copy of the callbacks stored in the
remote.
Remove the copy and simply access the callbacks struct within the
remote.
|
| |
|
|
|
|
|
| |
This is what it's meant all along, but now we actually have multiple
implementations, it's clearer to use the name of the library.
|
|
|
|
|
| |
Instead, provide git_tls_stream_new() to ask for the most appropriate
encrypted stream and use it in our HTTP transport.
|
|
|
|
|
| |
As an alternative to OpenSSL when we're on OS X. This one can actually
take advantage of stacking the streams.
|
|\
| |
| | |
Make sure to pack referenced objects for non-branches
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When we insert e.g. a tag or tagged object into the packfile, we must
make sure to insert any referenced objects as well, or we will have
broken links.
Use the recursive version of packfile insertion to make sure we send
over not just the tagged object but also the objects it references.
|
|\ \
| | |
| | | |
Add a custom param to git_smart_subtransport_definition
|
| | |
| | |
| | |
| | |
| | | |
The smart transport has already take the payload param. For the
sub transport a payload param is useful for the implementer.
|
|\ \ \
| | | |
| | | | |
WinHTTP for MinGW
|
| | | | |
|
| | | | |
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | | |
In case of a bad url or other error during the connection setup, we
close the stream via free.
|
|\ \ \
| | | |
| | | | |
[WIP] Smarter pack-building
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently we use the most naïve and inefficient method for figuring out
which objects to send to the remote whereby we end up trying to insert
subdirs which have not changed multiple times.
Instead, make use of the packbuilder's built-in more efficient method
which uses the walk to feed the object list and avoids inserting an
object and its descendants.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
When the user has a certificate check callback set, we still have to
check whether the stream we're using is even capable of providing a
certificate.
In the case of an unencrypted certificate, do not ask for it from the
stream, and do not call the callback.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
The default behaviour for the packbuilder is to perform the work in a
single thread, which is fine for the public API, but we currently have
no way for a user to determine the number of threads to use when
creating the packfile, which makes our clone behaviour over the
filesystem quite a bit slower than what git offers.
This is a very particular scenario, in which we avoid spawning git by
being ourselves the server-side, so it's probably ok to auto-set the
threading, as the upload-pack process would do if we were talking to
git.
|
|
|
|
|
|
| |
The user may decide to return any type of credential, including ones we
did not say we support. Add a check to make sure the user returned an
object of the right type and error out if not.
|
|
|
|
|
|
|
|
|
|
| |
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.
In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
|
|
|
|
|
|
|
|
|
| |
Make our overflow checking look more like gcc and clang's, so that
we can substitute it out with the compiler instrinsics on platforms
that support it. This means dropping the ability to pass `NULL` as
an out parameter.
As a result, the macros also get updated to reflect this as well.
|
|
|
|
|
|
| |
Use `size_t` to hold the size of arrays to ease overflow checking,
lest we check for overflow of a `size_t` then promptly truncate
by packing the length into a smaller type.
|
|
|
|
|
| |
Introduce `git_buf_grow_by` to incrementally increase the size of a
`git_buf`, performing an overflow calculation on the growth.
|
|
|
|
|
| |
Introduce some helper macros to test integer overflow from arithmetic
and set error message appropriately.
|
| |
|
|
|
|
|
| |
Pretend we have a git process at the other end by creating a similar
progress output when inserting objects into the packbuilder.
|
|\
| |
| | |
Introduce stackable IO streams
|
| | |
|
| |
| |
| |
| |
| |
| | |
Most of the network-facing facilities have been copied to the socket and
openssl streams. No code now uses these functions directly anymore, so
we can now remove them.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Having an ssh stream would require extra work for stream capabilities we
don't need anywhere else (oob auth and command execution) so for now
let's move away from the gitno connection to use socket_stream.
We can introduce an ssh stream interface if and as we need it.
|
| | |
|
| | |
|