summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* docs: git_treebuilder_insert validates entriesethomson/treebuilder_docsEdward Thomson2017-12-311-3/+4
| | | | | | | The documentation for `git_treebuilder_insert` erroneously states that we do not validate that the entry being inserted exists. We do, as of https://github.com/libgit2/libgit2/pull/3633. Update the documentation to reflect the new reality.
* Merge pull request #4159 from richardipsum/notes-commitEdward Thomson2017-12-303-48/+527
|\ | | | | Support using notes via a commit rather than a ref
| * notes: Add test that read of noteless commit failsRichard Ipsum2017-12-021-0/+25
| |
| * notes: Rewrite funcs in terms of note_commit funcsRichard Ipsum2017-12-021-81/+86
| |
| * notes: Add git_note_commit_iterator_newRichard Ipsum2017-10-073-0/+76
| | | | | | | | This also adds tests for this function.
| * notes: Add git_note_commit_removeRichard Ipsum2017-10-073-2/+105
| | | | | | | | This also adds tests for this function.
| * notes: Add git_note_commit_readRichard Ipsum2017-10-073-0/+81
| | | | | | | | This also adds tests for this function.
| * notes: Add git_note_commit_createRichard Ipsum2017-10-073-0/+183
| | | | | | | | | | | | | | | | | | | | 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.
| * notes: Make note_write return commit oidRichard Ipsum2017-09-231-4/+10
| | | | | | | | | | 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.
* | Merge pull request #4028 from chescock/improve-local-fetchEdward Thomson2017-12-303-175/+25
|\ \ | | | | | | Transfer fewer objects on push and local fetch
| * | Use git_packbuilder_insert_walk in queue_objects.Chris Hescock2016-12-201-169/+2
| | |
| * | Don't fetch objects we don't need in local transport.Chris Hescock2016-12-202-6/+23
| | | | | | | | | | | | | | | Hide all local refs in the revwalk. Packbuilder should not add hidden trees or blobs.
* | | Merge pull request #4455 from libgit2/ethomson/branch_symlinksEdward Thomson2017-12-304-19/+105
|\ \ \ | | | | | | | | refs: traverse symlinked directories
| * | | refs:iterator: add tests to recurse symlinksethomson/branch_symlinksEdward Thomson2017-12-301-18/+66
| | | | | | | | | | | | | | | | Ensure that we can recurse into directories via symbolic links.
| * | | iterator: cleanups with symlink dir handlingEdward Thomson2017-12-303-17/+32
| | | | | | | | | | | | | | | | Perform some error checking when examining symlink directories.
| * | | branches: Check symlinked subdirectoriesAndy Doan2017-12-293-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Merge pull request #4443 from libgit2/ethomson/large_loose_blobsEdward Thomson2017-12-3010-136/+352
|\ \ \ \ | |/ / / |/| | | Inflate large loose blobs
| * | | tests: add GITTEST_SLOW env var checkethomson/large_loose_blobsEdward Thomson2017-12-201-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing very large files may be slow, particularly on inefficient filesystems and when running instrumented code to detect invalid memory accesses (eg within valgrind or similar tools). Introduce `GITTEST_SLOW` so that tests that are slow can be skipped by the CI system.
| * | | hash: commoncrypto hash should support large filesEdward Thomson2017-12-201-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | hash: win32 hash mechanism should support large filesEdward Thomson2017-12-201-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | odb_loose: reject objects that cannot fit in memoryEdward Thomson2017-12-202-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | zstream: use UINT_MAX sized chunksEdward Thomson2017-12-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | odb: support large loose objectsEdward Thomson2017-12-201-98/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | | object: introduce git_object_stringn2typeEdward Thomson2017-12-202-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | odb: test loose reading/writing large objectsEdward Thomson2017-12-201-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a test for very large objects in the ODB. Write a large object (5 GB) and ensure that the write succeeds and provides us the expected object ID. Introduce a test that writes that file and ensures that we can subsequently read it.
| * | | util: introduce `git__prefixncmp` and consolidate implementationsEdward Thomson2017-12-203-16/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce `git_prefixncmp` that will search up to the first `n` characters of a string to see if it is prefixed by another string. This is useful for examining if a non-null terminated character array is prefixed by a particular substring. Consolidate the various implementations of `git__prefixcmp` around a single core implementation and add some test cases to validate its behavior.
| * | | zstream: treat `Z_BUF_ERROR` as non-fatalEdward Thomson2017-12-201-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | zlib will return `Z_BUF_ERROR` whenever there is more input to inflate or deflate than there is output to store the result. This is normal for us as we iterate through the input, particularly with very large input buffers.
* | | | Merge pull request #4021 from carlosmn/cmn/refspecs-fetchheadEdward Thomson2017-12-285-9/+113
|\ \ \ \ | | | | | | | | | | FETCH_HEAD and multiple refspecs
| * | | | fetch: go over FETCH_HEAD just once when counting the prefixes in testCarlos Martín Nieto2017-12-261-21/+26
| | | | |
| * | | | remote: append to FETCH_HEAD rather than overwrite for each refspecCarlos Martín Nieto2017-12-262-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We treat each refspec on its own, but the code currently overwrites the contents of FETCH_HEAD so we end up with the entries for the last refspec we processed. Instead, truncate it before performing the updates and append to it when updating the references.
| * | | | futils: add a function to truncate a fileCarlos Martín Nieto2017-12-262-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | We want to do this in order to get FETCH_HEAD to be empty when we start updating it due to fetching from the remote.
| * | | | fetch: add a failing test for FETCH_HEAD with multiple fetch refspecsCarlos Martín Nieto2017-12-261-0/+59
| | | | |
| * | | | fetch: expand fetchhead test to cover providing multiple refspecsCarlos Martín Nieto2017-11-191-8/+16
| | | | |
* | | | | Merge pull request #4285 from pks-t/pks/patches-with-whitespaceEdward Thomson2017-12-233-8/+58
|\ \ \ \ \ | | | | | | | | | | | | patch_parse: fix parsing unquoted filenames with spaces
| * | | | | patch_parse: allow parsing ambiguous patch headersPatrick Steinhardt2017-11-113-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git patch format allows for having unquoted paths with whitespaces inside. This format becomes ambiguous to parse, e.g. in the following example: diff --git a/file b/with spaces.txt b/file b/with spaces.txt While we cannot parse this in a correct way, we can instead use the "---" and "+++" lines to retrieve the file names, as the path is not followed by anything here but spans the complete remaining line. Because of this, we can simply bail outwhen parsing the "diff --git" header here without an actual error and then proceed to just take the paths from the other headers.
| * | | | | patch_parse: treat complete line after "---"/"+++" as pathPatrick Steinhardt2017-11-111-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing the "---" and "+++" line, we stop after the first whitespace inside of the filename. But as files containing whitespaces do not need to be quoted, we should instead use the complete line here. This fixes parsing patches with unquoted paths with whitespaces.
* | | | | | Merge pull request #4045 from lhchavez/fix-unpack-double-freeEdward Thomson2017-12-233-8/+68
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix unpack double free
| * | | | | | Fix unpack double freelhchavez2017-12-233-8/+68
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an element has been cached, but then the call to packfile_unpack_compressed() fails, the very next thing that happens is that its data is freed and then the element is not removed from the cache, which frees the data again. This change sets obj->data to NULL to avoid the double-free. It also stops trying to resolve deltas after two continuous failed rounds of resolution, and adds a test for this.
* | | | | | Merge pull request #4430 from tiennou/fix/openssl-x509-leakEdward Thomson2017-12-231-12/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | Free OpenSSL peer certificate
| * | | | | | openssl: free the peer certificateEtienne Samson2017-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per SSL_get_peer_certificate docs: ``` The reference count of the X509 object is incremented by one, so that it will not be destroyed when the session containing the peer certificate is freed. The X509 object must be explicitly freed using X509_free(). ```
| * | | | | | openssl: merge all the exit paths of verify_server_certEtienne Samson2017-12-161-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to cleanup allocated resources on exit.
* | | | | | | Merge pull request #4435 from lhchavez/ubsan-shift-overflowEdward Thomson2017-12-231-6/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | libFuzzer: Prevent a potential shift overflow
| * | | | | | | Simplified overflow conditionlhchavez2017-12-151-3/+1
| | | | | | | |
| * | | | | | | Using unsigned insteadlhchavez2017-12-091-6/+8
| | | | | | | |
| * | | | | | | libFuzzer: Prevent a potential shift overflowlhchavez2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type of |base_offset| in get_delta_base() is `git_off_t`, which is a signed `long`. That means that we need to make sure that the 8 most significant bits are zero (instead of 7) to avoid an overflow when it is shifted by 7 bits. Found using libFuzzer.
* | | | | | | | Merge pull request #4402 from libgit2/ethomson/iconvEdward Thomson2017-12-232-3/+7
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | cmake: let USE_ICONV be optional on macOS
| * | | | | | | | cmake: let USE_ICONV be optional on macOSethomson/iconvEdward Thomson2017-11-112-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of forcing iconv support on macOS (by forcing `USE_ICONV` on), honor the `USE_ICONV` option only on macOS. Although macOS includes iconv by default, some macOS users may have a deficient installation for some reason and they should be provided a workaround to use libgit2 even in this situation. iconv support is now disabled entirely on non-macOS platforms. No other platform supports core.precomposeunicode, and iconv should never be linked.
* | | | | | | | | Merge pull request #4429 from novalis/delete-modify-submodule-mergeEdward Thomson2017-12-235-2/+44
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / |/| | | | | | | | Do not attempt to check out submodule as blob when merging a submodule modify/deltete conflict
| * | | | | | | | Do not attempt to check out submodule as blob when merging a submodule ↵David Turner2017-12-045-2/+44
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | modify/deltete conflict
* | | | | | | | Merge pull request #4449 from libgit2/charliesome/git-authors-jonathan-tanEdward Thomson2017-12-191-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add Jonathan Tan to git.git-authors