summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* odb_loose: HEADER_LEN -> MAX_HEADER_LENethomson/odb_loose_readstreamEdward Thomson2018-02-011-7/+7
| | | | `MAX_HEADER_LEN` is a more descriptive constant name.
* odb_loose: largefile tests only on 64 bit platformsEdward Thomson2018-02-011-1/+14
| | | | | | | | Only run the large file tests on 64 bit platforms. Even though we support streaming reads on objects, and do not need to fit them in memory, we use `size_t` in various places to reflect the size of an object.
* odb_loose: validate length when checking for zlib contentEdward Thomson2018-02-011-4/+7
| | | | | When checking to see if a file has zlib deflate content, make sure that we actually have read at least two bytes before examining the array.
* odb_loose: test read_header on large blobsEdward Thomson2018-02-011-0/+16
| | | | | | Test that we can read_header on large blobs. This should succeed on all platforms since we read only a few bytes into memory to be able to parse the header.
* odb_loose: test read_header explicitlyEdward Thomson2018-02-011-0/+30
|
* odb_loose: `read_header` for packlike loose objectsEdward Thomson2018-02-011-20/+46
| | | | | | | | | | | Support `read_header` for "packlike loose objects", which were a temporarily and uncommonly used format loose object format that encodes the header before the zlib deflate data. This will never actually be seen in the wild, but add support for it for completeness and (more importantly) because our corpus of test data has objects in this format, so it's easier to support it than to try to special case it.
* odb_loose: read_header should use zstreamEdward Thomson2018-02-011-85/+24
| | | | | Make `read_header` use the common zstream implementation. Remove the now unnecessary zlib wrapper in odb_loose.
* zstream: introduce a single chunk readerEdward Thomson2018-02-012-36/+55
| | | | | | | Introduce `get_output_chunk` that will inflate/deflate all the available input buffer into the output buffer. `get_output` will call `get_output_chunk` in a loop, while other consumers can use it to inflate only a piece of the data.
* odb: test loose object streamingEdward Thomson2018-02-011-0/+54
|
* odb_loose: packlike loose objects use `git_zstream`Edward Thomson2018-02-011-88/+71
| | | | | Refactor packlike loose object reads to use `git_zstream` for simplification.
* odb: loose object streaming for packlike loose objectsEdward Thomson2018-02-011-37/+84
| | | | | | | A "packlike" loose object was a briefly lived loose object format where the type and size were encoded in uncompressed space at the beginning of the file, followed by the compressed object contents. Handle these in a streaming manner as well.
* odb_loose: test reading a large file in streamEdward Thomson2018-02-011-1/+47
| | | | | | Since some test situations may have generous disk space, but limited RAM (eg hosted build agents), test that we can stream a large file into a loose object, and then stream it out of the loose object storage.
* odb: introduce streaming loose object readerEdward Thomson2018-02-011-7/+148
| | | | Provide a streaming loose object reader.
* odb: provide length and type with streaming readEdward Thomson2018-02-013-4/+17
| | | | | The streaming read functionality should provide the length and the type of the object, like the normal read functionality does.
* odb_loose: stream -> writestreamEdward Thomson2018-02-011-8/+8
| | | | | | | There are two streaming functions; one for reading, one for writing. Disambiguate function names between `stream` and `writestream` to make allowances for a read stream.
* Merge pull request #4040 from tiennou/examples/mergePatrick Steinhardt2018-02-017-36/+447
|\ | | | | Merge example
| * examples: zero out our options memory before useEtienne Samson2018-01-251-0/+2
| |
| * examples: our/their can be NULLEtienne Samson2018-01-251-2/+4
| |
| * examples: fix remaining review commentsEtienne Samson2018-01-251-0/+2
| |
| * examples: move support code into static functionsEtienne Samson2018-01-251-81/+97
| |
| * examples: hoist the merge analysis back into mainEtienne Samson2018-01-251-58/+39
| |
| * examples: minor review fixupsEtienne Samson2018-01-251-10/+12
| |
| * examples: add mergeEtienne Samson2018-01-251-0/+391
| |
| * examples: Dead code & warningsEtienne Samson2018-01-251-7/+0
| |
| * examples: Move xrealloc to common example codeEtienne Samson2018-01-253-10/+15
| |
| * examples: Switch to the nifty argv helpers from commonEtienne Samson2018-01-252-19/+36
| |
* | Merge pull request #4507 from tomas/patch-1Edward Thomson2018-01-311-2/+7
|\ \ | | | | | | Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`
| * | Set ctime/mtime nanosecs to 0 if USE_NSEC is not definedTomás Pollak2018-01-311-0/+3
| | |
| * | Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`Tomás Pollak2018-01-301-2/+4
| | | | | | | | | | | | | | | | | | This should have been part of PR #3638. Without this we still get nsec-related errors, even when using -DGIT_USE_NSEC: error: ‘struct stat’ has no member named ‘st_mtime_nsec’
* | | Merge pull request #4488 from libgit2/ethomson/conflict_marker_sizeEdward Thomson2018-01-317-8/+23
|\ \ \ | | | | | | | | Use longer conflict markers in recursive merge base
| * | | CHANGELOG: include merge_file conflict marker sizeethomson/conflict_marker_sizeEdward Thomson2018-01-211-0/+6
| | | |
| * | | merge: recursive uses larger conflict markersEdward Thomson2018-01-214-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git uses longer conflict markers in the recursive merge base - two more than the default (thus, 9 character long conflict markers). This allows users to tell the difference between the recursive merge conflicts and conflicts between the ours and theirs branches. This was introduced in git d694a17986a28bbc19e2a6c32404ca24572e400f. Update our tests to expect this as well.
| * | | merge: allow custom conflict marker sizeEdward Thomson2018-01-212-0/+8
| | |/ | |/| | | | | | | | | | | | | Allow for a custom conflict marker size, allowing callers to override the default size of the "<<<<<<<" and ">>>>>>>" markers in the conflicted output file.
* | | Merge pull request #4490 from libgit2/ethomson/apfs_precompose_fixesEdward Thomson2018-01-311-1/+7
|\ \ \ | |_|/ |/| | status::renames: test update for APFS (write NFD instead of NFC filename)
| * | status::renames: write NFD instead of NFC filenameethomson/apfs_precompose_fixesEdward Thomson2018-01-211-1/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the status::renames test to create an NFD format filename in the core.precomposedunicode tests. Previously, we would create an NFC format filename. This was to take advantage of HFS+ filesystems, which always use canonically decomposed formats, and would actually write the filename to disk as an NFD filename. So previously, we could create an NFC filename, but read it normally as an NFD filename. But APFS formats do not force canonically decomposed formats for filenames, so creating an NFC filename does not get converted to NFD. Instead, the filename will be written in NFC format. Our test, therefore, does not work - when we write an NFC filename, it will _remain_ NFC. Update the test to write NFD always. This will ensure that the file will actually be canonically decomposed on all platforms: HFS+, which forces NFD, and APFS, which does not. Thus, our test will continue to ensure that an NFD filename is canonically precomposed on all filesystems.
* | Merge pull request #4474 from pks-t/pks/null-oidEdward Thomson2018-01-294-1/+60
|\ \ | | | | | | Special-casing null OIDs
| * | odb: reject reading and writing null OIDsPatrick Steinhardt2018-01-262-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | The null OID (hash with all zeroes) indicates a missing object in upstream git and is thus not a valid object ID. Add defensive measurements to avoid writing such a hash to the object database in the very unlikely case where some data results in the null OID. Furthermore, add shortcuts when reading the null OID from the ODB to avoid ever returning an object when a faulty repository may contain the null OID.
| * | tree: reject writing null-OID entries to a treePatrick Steinhardt2018-01-262-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit a96d3cc3f (cache-tree: reject entries with null sha1, 2017-04-21), the git.git project has changed its stance on null OIDs in tree objects. Previously, null OIDs were accepted in tree entries to help tools repair broken history. This resulted in some problems though in that many code paths mistakenly passed null OIDs to be added to a tree, which was not properly detected. Align our own code base according to the upstream change and reject writing tree entries early when the OID is all-zero.
* | | Merge pull request #4502 from pks-t/pks/security-reportingEdward Thomson2018-01-291-0/+6
|\ \ \ | |/ / |/| | README.md: add notes on how to report security issues
| * | README.md: add notes on how to report security issuesPatrick Steinhardt2018-01-291-0/+6
|/ /
* | Merge pull request #4497 from medranocalvo/export-mempackPatrick Steinhardt2018-01-252-4/+6
|\ \ | |/ |/| odb: export mempack backend
| * odb: export mempack backendAdrián Medraño Calvo2018-01-222-4/+6
|/ | | | Fixes #4492, #4496.
* Merge pull request #4484 from pks-t/pks/fail-creating-branch-HEADEdward Thomson2018-01-201-0/+6
|\ | | | | branch: refuse creating branches named 'HEAD'
| * branch: refuse creating branches named 'HEAD'Patrick Steinhardt2018-01-191-0/+6
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #4478 from libgit2/cmn/packed-refs-sortedEdward Thomson2018-01-201-1/+1
|\ \ | | | | | | refs: include " sorted " in our packed-refs header
| * | refs: include " sorted " in our packed-refs headercmn/packed-refs-sortedCarlos Martín Nieto2018-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #4483 from libgit2/cmn/prettify-docsEdward Thomson2018-01-201-3/+2
|\ \ \ | | | | | | | | message: update docs for git_message_prettify
| * | | message: update docs for git_message_prettifycmn/prettify-docsCarlos Martín Nieto2018-01-191-3/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | We used to hard-code the octothorpe as the comment character and the documentation still mentions this even though we accept the comment character as a parameter. Update the line to indicate this and clean up the first paragraph a bit.
* | | Merge pull request #4481 from pks-t/pks/tests-online-clone-url-memleakCarlos Martín Nieto2018-01-191-0/+2
|\ \ \ | |/ / |/| | tests: online::clone: fix memory leak due to not freeing URL
| * | tests: online::clone: fix memory leak due to not freeing URLPatrick Steinhardt2018-01-181-0/+2
|/ /