summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | iterator: add tests for advance_overEdward Thomson2016-03-231-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | `git_iterator_advance_over` is a gnarly bit of code with no actual tests.
| * | | | iterator: test workdir pathlist with deep pathsEdward Thomson2016-03-231-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the workdir iterator we do some tricky things to step down into directories to look for things that are in our pathlist. Make sure that we don't confuse between folders that we're definitely going to return everything in and folders that we're only stepping down into to keep looking for matches.
| * | | | iterator: workdir tests with submodulesEdward Thomson2016-03-231-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | Ensure that when specifying start/end paths, or pathlists, that we deal correctly with submodules.
| * | | | iterator: expand workdir tests with pathlistEdward Thomson2016-03-231-62/+224
| | | | | | | | | | | | | | | | | | | | | | | | | Expand the workdir tests to validate the paths in case sensitive and insensitive tests.
| * | | | iterator: test that we're at the end of iterationEdward Thomson2016-03-232-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that we have hit the end of iteration; previously we tested that we saw all the values that we expected to see. We did not then ensure that we were at the end of the iteration (and that there were subsequently values in the iteration that we did *not* expect.)
| * | | | iterator: combine fs+workdir iterators more completelyEdward Thomson2016-03-234-944/+1082
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop some of the layers of indirection between the workdir and the filesystem iterators. This makes the code a little bit easier to follow, and reduces the number of unnecessary allocations a bit as well. (Prior to this, when we filter entries, we would allocate them, filter them and then free them; now we do the filtering before allocation.) Also, rename `git_iterator_advance_over_with_status` to just `git_iterator_advance_over`. Mostly because it's a fucking long-ass function name otherwise.
| * | | | iterator: test fs iterator w/ many nested empty dirsEdward Thomson2016-03-231-0/+30
| | | | |
| * | | | iterator: skip unreadable directories in fs iteratorEdward Thomson2016-03-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Do not abort iteration in the middle when encountering an unreadable directory. Instead, skip it, as if it didn't exist.
| * | | | checkout: provide internal func to compute target pathEdward Thomson2016-03-231-32/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many code paths in checkout need the final, full on-disk path of the file they're writing. (No surprise). However, they all munge the `data->path` buffer themselves to get there. Provide a nice helper method for them. Plus, drop the use `git_iterator_current_workdir_path` which does the same thing but different. Checkout is the only caller of this silly function, which lets us remove it.
| * | | | iterators: refactored tree iteratorEdward Thomson2016-03-234-403/+634
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the tree iterator to never recurse; simply process the next entry in order in `advance`. Additionally, reduce the number of allocations and sorting as much as possible to provide a ~30% speedup on case-sensitive iteration. (The gains for case-insensitive iteration are less majestic.)
| * | | | repo::iterator: don't go out of boundsEdward Thomson2016-03-231-2/+2
| | | | |
| * | | | git_object_dup: introduce typesafe versionsEdward Thomson2016-03-238-5/+59
| | | | |
| * | | | iterator: disambiguate reset and reset_rangeEdward Thomson2016-03-236-31/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disambiguate the reset and reset_range functions. Now reset_range with a NULL path will clear the start or end; reset will leave the existing start and end unchanged.
| * | | | iterator: drop unused/unimplemented `seek`Edward Thomson2016-03-232-37/+0
| | | | |
| * | | | status: update test to include valid OIDEdward Thomson2016-03-231-1/+1
| |/ / /
* | | | Merge pull request #3574 from chescock/buffer-sideband-pack-dataCarlos Martín Nieto2016-03-241-17/+61
|\ \ \ \ | |/ / / |/| | | Buffer sideband packet data
| * | | Only buffer if necessary.Chris Hescock2016-03-081-18/+39
| | | |
| * | | Buffer sideband packet dataChris Hescock2016-01-121-18/+41
| | |/ | |/| | | | | | | The inner packet may be split across multiple sideband packets.
* | | Merge pull request #3707 from sschuberth/masterEdward Thomson2016-03-231-1/+1
|\ \ \ | | | | | | | | CMakeLists: Show the pointer size for an unsupported architecture
| * | | CMakeLists: Show the pointer size for an unsupported architectureSebastian Schuberth2016-03-231-1/+1
|/ / / | | | | | | | | | | | | Showing the pointer size gives a hint as to why we think this is an unsupported architecture.
* | | array: fix search for empty arraysCarlos Martín Nieto2016-03-231-1/+1
| | | | | | | | | | | | | | | When the array is empty `cmp` never gets set by the comparison function. Initialize it so we return ENOTFOUND in those cases.
* | | Merge pull request #3704 from ethomson/tree-reuseCarlos Martín Nieto2016-03-234-46/+125
|\ \ \ | | | | | | | | tree: drop the now-unnecessary entries vector
| * | | tree: drop the now-unnecessary entries vectorEdward Thomson2016-03-224-46/+125
| | | | | | | | | | | | | | | | | | | | Remove the now-unnecessary entries vector. Add `git_array_search` to binary search through an array to accomplish this.
* | | | Merge pull request #3502 from libgit2/cmn/createblob-streamCarlos Martín Nieto2016-03-227-196/+233
|\ \ \ \ | | | | | | | | | | Add ability to write a filtered blob through a stream
| * | | | blob: remove _fromchunks()cmn/createblob-streamCarlos Martín Nieto2016-03-223-216/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callback mechanism makes it awkward to write data from an IO source; move to `_fromstream()` which lets the caller remain in control, in the same vein as we prefer iterators over foreach callbacks.
| * | | | CHANGELOG: add a note about _fromstream() and _fromstream_commit()Carlos Martín Nieto2016-03-221-0/+5
| | | | |
| * | | | blob: fix fromchunks iteration counterCarlos Martín Nieto2016-03-222-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By returning when the count goes to zero rather than below it, setting `howmany` to 7 in fact writes out the string 6 times. Correct the termination condition to write out the string the amount of times we specify.
| * | | | blob: introduce creating a blob by writing into a streamCarlos Martín Nieto2016-03-223-0/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pair of `git_blob_create_frombuffer()` and `git_blob_create_frombuffer_commit()` is meant to replace `git_blob_create_fromchunks()` by providing a way for a user to write a new blob when they want filtering or they do not know the size. This approach allows the caller to retain control over when to add data to this buffer and a more natural fit into higher-level language's own stream abstractions instead of having to handle IO wait in the callback. The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a round multiple of usual page sizes and a value where most blobs seem likely to be either going to be way below or way over that size. It's also a round number of pages. This implementation re-uses the helper we have from `_fromchunks()` so we end up writing everything to disk, but hopefully more efficiently than with a default filebuf. A later optimisation can be to avoid writing the in-memory contents to disk, with some extra complexity.
| * | | | filebuf: allow using a custom buffer sizeCarlos Martín Nieto2016-03-222-1/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | Allow setting the buffer size on open in order to use this data structure more generally as a spill buffer, with larger buffer sizes for specific use-cases.
* | | | Merge pull request #3559 from yongthecoder/masterCarlos Martín Nieto2016-03-221-2/+7
|\ \ \ \ | | | | | | | | | | Add a sanity check in git_indexer_commit to avoid subtraction overflow.
| * | | | Avoid subtraction overflow in git_indexer_commitYong Li2016-01-041-2/+7
| | | | |
* | | | | Merge pull request #3701 from jfultz/fix-0.24.0-changelogCarlos Martín Nieto2016-03-221-1/+4
|\ \ \ \ \ | |_|/ / / |/| | | | Fix some errors I found in the changelog for 0.24.0
| * | | | Fix some errors I found in the changelog for 0.24.0John Fultz2016-03-181-1/+4
| | | | |
* | | | | Merge pull request #3702 from libgit2/cmn/tree-reuseEdward Thomson2016-03-218-83/+76
|\ \ \ \ \ | |_|_|_|/ |/| | | | Reuse a tree's buffer and allocate constant-sized entries in an array
| * | | | tree: store the entries in a growable arraycmn/tree-reuseCarlos Martín Nieto2016-03-202-60/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Take advantage of the constant size of tree-owned arrays and store them in an array instead of a pool. This still lets us free them all at once but lets the system allocator do the work of fitting them in.
| * | | | tree: re-use the id and filename in the odb objectCarlos Martín Nieto2016-03-208-52/+67
|/ / / / | | | | | | | | | | | | | | | | Instead of copying over the data into the individual entries, point to the originals, which are already in a format we can use.
* | | | Merge pull request #3699 from libgit2/cmn/win32-free-tlsEdward Thomson2016-03-181-0/+14
|\ \ \ \ | | | | | | | | | | win32: free thread-local data on thread exit
| * | | | win32: free thread-local data on thread exitcmn/win32-free-tlsCarlos Martin Nieto2016-03-181-0/+14
| | | | |
* | | | | Merge pull request #3660 from mstrap/mingwEdward Thomson2016-03-181-0/+2
|\ \ \ \ \ | | | | | | | | | | | | MinGW builds should optionally create DLLs without "lib" prefix
| * | | | | Option "LIBGIT2_PREFIX" to set the CMAKE's TARGET_PROPERTIES PREFIXMarc Strapetz2016-03-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is especially useful in combination with MinGW to yield the Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"
* | | | | | Merge pull request #3564 from ethomson/merge_driversCarlos Martín Nieto2016-03-1711-115/+1309
|\ \ \ \ \ \ | | | | | | | | | | | | | | Custom merge drivers and proper gitattributes `merge` handling
| * | | | | | merge drivers: handle configured but not found driverEdward Thomson2016-03-172-4/+31
| | | | | | |
| * | | | | | merge driver: remove `check` callbackEdward Thomson2016-03-176-306/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the `apply` callback can defer, the `check` callback is not necessary. Removing the `check` callback further makes the `payload` unnecessary along with the `cleanup` callback.
| * | | | | | merge driver: improve inline documentationEdward Thomson2016-03-171-18/+21
| | | | | | |
| * | | | | | merge driver: correct global initializationEdward Thomson2016-03-175-94/+160
| | | | | | |
| * | | | | | merge driver: get a pointer to favorEdward Thomson2016-03-172-4/+9
| | | | | | |
| * | | | | | merge driver: correct indentationEdward Thomson2016-03-172-30/+30
| | | | | | |
| * | | | | | merge driver: tests for set and unset merge attributeEdward Thomson2016-03-171-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that setting the merge attribute forces the built-in default `text` driver and does *not* honor the `merge.default` configuration option. Further ensure that unsetting the merge attribute forces a conflict (the `binary` driver).
| * | | | | | merge driver: tests for custom default merge driversEdward Thomson2016-03-171-0/+59
| | | | | | |
| * | | | | | merge driver: allow custom default driverEdward Thomson2016-03-175-43/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow merge users to configure a custom default merge driver via `git_merge_options`. Similarly, honor the `merge.default` configuration option.