| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
branch: refuse creating branches named 'HEAD'
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since a625b092c (branch: correctly reject refs/heads/{-dash,HEAD},
2017-11-14), which is included in v2.16.0, upstream git refuses to
create branches which are named HEAD to avoid ambiguity with the
symbolic HEAD reference. Adjust our own code to match that behaviour and
reject creating branches names HEAD.
|
|\ \
| |/
|/| |
refs: include " sorted " in our packed-refs header
|
| |
| |
| |
| |
| |
| |
| | |
This lets git know that we do in fact have written our packed-refs file
sorted (which is apparently not necessarily the case) and it can then use the
new-ish mmaped access which lets it avoid significant amounts of effort parsing
potentially large files to get to a single piece of data.
|
|\ \
| | |
| | | |
Implement message trailer parsing API
|
| | | |
|
| | | |
|
| |\ \
| | |/ |
|
| | | |
|
| | | |
|
| |\ \ |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This is implemented in trailer.c and borrows a large amount of logic
from Git core to ensure compatibility.
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Upon downloading the pack file, the local transport will iterate through
every reference using `git_reference_foreach`. The function is a bit
tricky though in that it requires the passed callback to free the
references, which does not currently happen.
Fix the memory leak by freeing all passed references in the callback.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We might want OpenSSL to be the implementation for SHA-1 and/or TLS. If we only
want it for TLS (e.g. we're building with the collision-detecting SHA-1
implementation) then we did not indicate this to the systems including us a
static library.
Add OpenSSL to the list also during the TLS decision to make sure we say we
should link to it if we use it for TLS.
|
| | |
| | |
| | |
| | |
| | |
| | | |
It is indeed a list of dependencies for those which include the static archive.
This is in preparation for adding two possible places where we might add openssl
as a dependency.
|
|\ \ \
| | | |
| | | | |
cmake: allow explicitly choosing SHA1 backend
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Right now, if SHA1DC is disabled, the SHA1 backend is mostly chosen
based on which system libgit2 is being compiled on and which libraries
have been found. To give developers and distributions more choice,
enable them to request specific backends by passing in a
`-DSHA1_BACKEND=<BACKEND>` option instead. This completely replaces the
previous auto-selection.
|
|\ \ \
| | | |
| | | | |
hash: openssl: check return values of SHA1_* functions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The function `ERR_error_string` can be invoked without providing a
buffer, in which case OpenSSL will simply return a string printed into a
static buffer. Obviously and as documented in ERR_error_string(3), this
is not thread-safe at all. As libgit2 is a library, though, it is easily
possible that other threads may be using OpenSSL at the same time, which
might lead to clobbered error strings.
Fix the issue by instead using a stack-allocated buffer. According to
the documentation, the caller has to provide a buffer of at least 256
bytes of size. While we do so, make sure that the buffer will never get
overflown by switching to `ERR_error_string_n` to specify the buffer's
size.
|
| | |/
| |/|
| | |
| | |
| | |
| | | |
The OpenSSL functions `SHA1_Init`, `SHA1_Update` and `SHA1_Final` all
return 1 for success and 0 otherwise, but we never check their return
values. Do so.
|
|\ \ \
| | | |
| | | | |
diff_generate: avoid excessive stats of .gitattribute files
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When generating a diff between two trees, for each file that is to be
diffed we have to determine whether it shall be treated as text or as
binary files. While git has heuristics to determine which kind of diff
to generate, users can also that default behaviour by setting or
unsetting the 'diff' attribute for specific files.
Because of that, we have to query gitattributes in order to determine
how to diff the current files. Instead of hitting the '.gitattributes'
file every time we need to query an attribute, which can get expensive
especially on networked file systems, we try to cache them instead. This
works perfectly fine for every '.gitattributes' file that is found, but
we hit cache invalidation problems when we determine that an attribuse
file is _not_ existing. We do create an entry in the cache for missing
'.gitattributes' files, but as soon as we hit that file again we
invalidate it and stat it again to see if it has now appeared.
In the case of diffing large trees with each other, this behaviour is
very suboptimal. For each pair of files that is to be diffed, we will
repeatedly query every directory component leading towards their
respective location for an attributes file. This leads to thousands or
even hundreds of thousands of wasted syscalls.
The attributes cache already has a mechanism to help in that scenario in
form of the `git_attr_session`. As long as the same attributes session
is still active, we will not try to re-query the gitmodules files at all
but simply retain our currently cached results. To fix our problem, we
can create a session at the top-most level, which is the initialization
of the `git_diff` structure, and use it in order to look up the correct
diff driver. As the `git_diff` structure is used to generate patches for
multiple files at once, this neatly solves our problem by retaining the
session until patches for all files have been generated.
The fix has been tested with linux.git by calling
`git_diff_tree_to_tree` and `git_diff_to_buf` with v4.10^{tree} and
v4.14^{tree}.
| time | .gitattributes stats
without fix | 33.201s | 844614
with fix | 30.327s | 4441
While execution only improved by roughly 10%, the stat(3) syscalls for
.gitattributes files decreased by 99.5%. The benchmarks were quite
simple with best-of-three timings on Linux ext4 systems. One can assume
that for network based file systems the performance gain will be a lot
larger due to a much higher latency.
|
|\ \ \
| | | |
| | | | |
cmake: create a dummy file for Xcode
|
| | |/
| |/|
| | | |
Otherwise Xcode will happily not-link our git2 target, resulting in a "missing file" error when building eg. examples
|
|\ \ \
| |_|/
|/| | |
tree: standard error messages are lowercase
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Our standard error messages begin with a lower case letter so that they
can be prefixed or embedded nicely.
These error messages were missed during the standardization pass since
they use the `tree_error` helper function.
|
|\ \ \
| |/ /
|/| | |
winhttp: properly support ntlm and negotiate
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When parsing unauthorized responses, properly parse headers looking for
both NTLM and Negotiate challenges. Set the HTTP credentials to default
credentials (using a `NULL` username and password) with the schemes
supported by ourselves and the server.
|
|\ \ \
| | | |
| | | | |
Support using notes via a commit rather than a ref
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
This also adds tests for this function.
|
| | | |
| | | |
| | | |
| | | | |
This also adds tests for this function.
|
| | | |
| | | |
| | | |
| | | | |
This also adds tests for this function.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This adds a new function that will allow creation of notes without
necessarily updating a particular ref, the notes tree is obtained
from the git_commit object parameter, a new commit object pointing
to the current tip of the notes tree is optionally returned
via the 'note_commit_out' parameter,
optionally the blob id for the note is returned through
the 'note_blob_out' object.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
For the new 'commit' API it will be necessary to know the OID
of the notes commit that was written as well as the OID of the notes blob.
|
|\ \ \ \
| | | | |
| | | | | |
Transfer fewer objects on push and local fetch
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Hide all local refs in the revwalk.
Packbuilder should not add hidden trees or blobs.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
refs: traverse symlinked directories
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Perform some error checking when examining symlink directories.
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Native Git allows symlinked directories under .git/refs. This
change allows libgit2 to also look for references that live under
symlinked directories.
Signed-off-by: Andy Doan <andy@opensourcefoundries.com>
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Inflate large loose blobs
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Teach the CommonCrypto hash mechanisms to support large files. The hash
primitives take a `CC_LONG` (aka `uint32_t`) at a time. So loop to give
the hash function at most an unsigned 32 bit's worth of bytes until we
have hashed the entire file.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Teach the win32 hash mechanisms to support large files. The hash
primitives take at most `ULONG_MAX` bytes at a time. Loop, giving the
hash function the maximum supported number of bytes, until we have
hashed the entire file.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Check the size of objects being read from the loose odb backend and
reject those that would not fit in memory with an error message that
reflects the actual problem, instead of error'ing later with an
unintuitive error message regarding truncation or invalid hashes.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Instead of paging to zlib in INT_MAX sized chunks, we can give it
as many as UINT_MAX bytes at a time. zlib doesn't care how big
a buffer we give it, this simply results in fewer calls into zlib.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
zlib will only inflate/deflate an `int`s worth of data at a time.
We need to loop through large files in order to ensure that we inflate
the entire file, not just an `int`s worth of data. Thankfully, we
already have this loop in our `git_zstream` layer. Handle large objects
using the `git_zstream`.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Introduce an internal API to get the object type based on a
length-specified (not null terminated) string representation. This can
be used to compare the (space terminated) object type name in a loose
object.
Reimplement `git_object_string2type` based on this API.
|