|
9eb9e5fa
|
2016-03-21T17:19:24
|
|
iterator: cleanups
Remove some unused functions, refactor some ugliness.
|
|
d712c2b2
|
2016-03-21T18:30:21
|
|
iterator: don't run the gunk test by default on CI
(It's slow!)
|
|
247e3b43
|
2016-03-21T16:51:45
|
|
iterator: mandate `advance_over`
Since the three iterators implement `advance_over` differently,
mandate it and implement each.
|
|
de034cd2
|
2016-03-18T10:59:38
|
|
iterator: give the tests a proper hierarchy
Iterator tests were split over repo::iterator and diff::iterator,
with duplication between the two. Move them to iterator::index,
iterator::tree, and iterator::workdir.
|
|
0ef0b71c
|
2016-03-21T12:54:47
|
|
iterator: refactor index iterator
|
|
35877463
|
2016-03-21T17:03:00
|
|
iterator: refactor empty iterator to new style
|
|
ba6f86eb
|
2016-03-18T17:33:46
|
|
Introduce `git_path_common_dirlen`
|
|
82a1aab6
|
2016-03-18T12:59:35
|
|
iterator: move the index into the iterator itself
|
|
df25daef
|
2016-01-04T12:12:24
|
|
Added clar test for #3568
|
|
67885532
|
2016-03-17T15:29:21
|
|
diff: stop processing nitem when its removed
When a directory is removed out from underneath us, stop trying to
manipulate it.
|
|
0a2e1032
|
2016-03-17T15:19:45
|
|
iterator: drop `advance_into_or_over`
Now that iterators do not return `GIT_ENOTFOUND` when advancing
into an empty directory, we do not need a special `advance_into_or_over`
function.
|
|
6cd9573f
|
2016-03-17T15:09:38
|
|
iterator: test that we can `advance_into` empty dirs
Prior iterator implementations returned `GIT_ENOTFOUND` when
trying to advance into empty directories. Ensure that we no longer
do that and simply handle them gracefully.
|
|
b6204260
|
2016-02-10T13:46:14
|
|
Failing test.
|
|
ae86aa5a
|
2016-03-16T11:38:02
|
|
iterator: test pathlist handling for directories
tree_iterator was only working properly for a pathlist containing
file paths. In case of directory paths, it didn't match children
which contradicts GIT_DIFF_DISABLE_PATHSPEC_MATCH and
is different from index_iterator and fs_iterator.
As a consequence head-to-index status reporting for a specific
directory did not work properly -- all files have been reported
as added.
Include additional tests.
|
|
6bcddf88
|
2016-03-16T17:14:36
|
|
iterator: test `advance_over` with a pathlist
|
|
9fb2527f
|
2016-03-16T16:29:38
|
|
iterator: add tests for advance_over
`git_iterator_advance_over` is a gnarly bit of code with no actual
tests.
|
|
85541f43
|
2016-03-16T13:31:35
|
|
iterator: test workdir pathlist with deep paths
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.
|
|
908d8de8
|
2016-03-16T12:15:55
|
|
iterator: workdir tests with submodules
Ensure that when specifying start/end paths, or pathlists, that we
deal correctly with submodules.
|
|
c3d195f1
|
2016-03-16T11:45:44
|
|
iterator: expand workdir tests with pathlist
Expand the workdir tests to validate the paths in case sensitive
and insensitive tests.
|
|
4c88198a
|
2016-03-16T10:17:20
|
|
iterator: test that we're at the end of iteration
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.)
|
|
0e0589fc
|
2016-03-10T00:04:26
|
|
iterator: combine fs+workdir iterators more completely
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.
|
|
d051de24
|
2016-03-10T12:54:33
|
|
iterator: test fs iterator w/ many nested empty dirs
|
|
a4f520a6
|
2016-03-10T11:07:13
|
|
iterator: skip unreadable directories in fs iterator
Do not abort iteration in the middle when encountering an unreadable
directory. Instead, skip it, as if it didn't exist.
|
|
702b23d7
|
2016-03-11T11:27:58
|
|
checkout: provide internal func to compute target path
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.
|
|
be30387e
|
2016-02-25T16:05:18
|
|
iterators: refactored tree iterator
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.)
|
|
277c85eb
|
2016-03-02T15:38:13
|
|
repo::iterator: don't go out of bounds
|
|
f0224772
|
2016-02-17T18:04:19
|
|
git_object_dup: introduce typesafe versions
|
|
684b35c4
|
2016-02-25T15:11:14
|
|
iterator: disambiguate reset and reset_range
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.
|
|
ac05086c
|
2016-02-25T14:51:23
|
|
iterator: drop unused/unimplemented `seek`
|
|
8a5a2e2f
|
2016-03-17T00:47:50
|
|
status: update test to include valid OID
|
|
63f7b7f9
|
2016-03-23T13:14:04
|
|
Merge pull request #3707 from sschuberth/master
CMakeLists: Show the pointer size for an unsupported architecture
|
|
f9601e6f
|
2016-03-23T20:37:39
|
|
CMakeLists: Show the pointer size for an unsupported architecture
Showing the pointer size gives a hint as to why we think this is an
unsupported architecture.
|
|
1a2d8bd3
|
2016-03-23T16:51:52
|
|
array: fix search for empty arrays
When the array is empty `cmp` never gets set by the comparison
function. Initialize it so we return ENOTFOUND in those cases.
|
|
661db4f4
|
2016-03-23T03:45:53
|
|
Merge pull request #3704 from ethomson/tree-reuse
tree: drop the now-unnecessary entries vector
|
|
0a7ce499
|
2016-03-22T14:34:35
|
|
Merge pull request #3502 from libgit2/cmn/createblob-stream
Add ability to write a filtered blob through a stream
|
|
6669e3e8
|
2015-11-08T04:28:08
|
|
blob: remove _fromchunks()
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.
|
|
e2bb9ed3
|
2015-11-04T10:39:55
|
|
CHANGELOG: add a note about _fromstream() and _fromstream_commit()
|
|
35e68606
|
2015-11-04T10:36:50
|
|
blob: fix fromchunks iteration counter
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.
|
|
0a5c6028
|
2015-11-04T10:30:48
|
|
blob: introduce creating a blob by writing into a stream
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.
|
|
3fa764ed
|
2015-11-04T09:20:14
|
|
filebuf: allow using a custom buffer size
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.
|
|
e2e4bae9
|
2016-03-22T00:18:44
|
|
tree: drop the now-unnecessary entries vector
Remove the now-unnecessary entries vector. Add `git_array_search`
to binary search through an array to accomplish this.
|
|
e50a49ee
|
2016-03-22T01:54:49
|
|
Merge pull request #3559 from yongthecoder/master
Add a sanity check in git_indexer_commit to avoid subtraction overflow.
|
|
cec320fe
|
2016-03-22T00:44:05
|
|
Merge pull request #3701 from jfultz/fix-0.24.0-changelog
Fix some errors I found in the changelog for 0.24.0
|
|
7adca53e
|
2016-03-21T21:29:33
|
|
Merge pull request #3702 from libgit2/cmn/tree-reuse
Reuse a tree's buffer and allocate constant-sized entries in an array
|
|
4ed9e939
|
2016-03-20T12:01:45
|
|
tree: store the entries in a growable array
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.
|
|
60a194aa
|
2016-03-20T11:00:12
|
|
tree: re-use the id and filename in the odb object
Instead of copying over the data into the individual entries, point to
the originals, which are already in a format we can use.
|
|
a177756b
|
2016-03-18T13:00:27
|
|
win32: free thread-local data on thread exit
|
|
0b24855e
|
2016-03-18T15:03:08
|
|
Fix some errors I found in the changelog for 0.24.0
|
|
ec5a43b6
|
2016-03-18T06:37:41
|
|
Merge pull request #3699 from libgit2/cmn/win32-free-tls
win32: free thread-local data on thread exit
|
|
3a43677e
|
2016-03-18T06:37:04
|
|
Merge pull request #3660 from mstrap/mingw
MinGW builds should optionally create DLLs without "lib" prefix
|
|
e18df18b
|
2016-03-17T18:01:37
|
|
Merge pull request #3564 from ethomson/merge_drivers
Custom merge drivers and proper gitattributes `merge` handling
|
|
e02acbb3
|
2016-03-17T17:25:49
|
|
Merge pull request #3695 from ethomson/contributing
CONTRIBUTING: document the optional tests
|
|
1308059d
|
2016-03-17T12:01:37
|
|
CONTRIBUTING: document the optional tests
|
|
d953c450
|
2016-02-28T21:30:00
|
|
merge drivers: handle configured but not found driver
|
|
6d8b2cdb
|
2016-02-28T09:34:11
|
|
merge driver: remove `check` callback
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.
|
|
3f7d3df1
|
2016-02-27T16:57:12
|
|
merge driver: improve inline documentation
|
|
967e073d
|
2016-02-27T16:42:02
|
|
merge driver: correct global initialization
|
|
59f29314
|
2015-12-23T23:44:58
|
|
merge driver: test GIT_PASSTHROUGH
When a `check` or `apply` callback function returns `GIT_PASSTHROUGH`,
move on to the default merge driver.
|
|
7a3ab14f
|
2016-02-07T15:58:34
|
|
merge driver: get a pointer to favor
|
|
46625836
|
2016-02-07T15:19:43
|
|
merge driver: correct indentation
|
|
58d33126
|
2015-12-26T19:47:17
|
|
merge driver: tests for set and unset merge attribute
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).
|
|
d3f0875a
|
2015-12-25T00:34:39
|
|
merge driver: tests for custom default merge drivers
|
|
30a94ab7
|
2015-12-24T22:52:23
|
|
merge driver: allow custom default driver
Allow merge users to configure a custom default merge driver via
`git_merge_options`. Similarly, honor the `merge.default` configuration
option.
|
|
7d307c1e
|
2015-12-23T23:52:02
|
|
merge driver: test GIT_EMERGECONFLICT
When a `check` or `apply` callback function returns `GIT_EMERGECONFLICT`
stop and product a conflict.
|
|
3f04219f
|
2015-12-23T10:23:08
|
|
merge driver: introduce custom merge drivers
Consumers can now register custom merged drivers with
`git_merge_driver_register`. This allows consumers to support the
merge drivers, as configured in `.gitattributes`. Consumers will be
asked to perform the file-level merge when a custom driver is
configured.
|
|
7a74590d
|
2015-12-03T09:57:56
|
|
Fix rebase bug and include test for merge=union
|
|
f8787098
|
2015-10-31T18:50:13
|
|
Support union merges via .gitattributes file
|
|
ba349322
|
2016-03-17T06:57:56
|
|
Merge pull request #3673 from libgit2/cmn/commit-with-signature
commit: add function to attach a signature to a commit
|
|
a151eb54
|
2016-03-17T06:55:24
|
|
Merge pull request #3685 from pks-t/pks/memleaks
Test memleaks
|
|
31dc0599
|
2016-03-17T06:54:03
|
|
Merge pull request #3687 from mstrap/CMAKE_C_FLAGS_DEBUG
CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
|
|
62e237e0
|
2016-03-17T06:43:54
|
|
Merge pull request #3693 from libgit2/cmn/extract-oneline-sig
commit: fix extraction of single-line signatures
|
|
bf804d40
|
2016-03-17T10:45:22
|
|
commit: fix extraction of single-line signatures
The function to extract signatures suffers from a similar bug to the
header field finding one by having an unecessary line feed check as a
break condition of its loop.
Fix that and add a test for this single-line signature situation.
|
|
de143efa
|
2016-03-16T14:12:14
|
|
Merge pull request #3690 from libgit2/cmn/pool-limit
win32: choose the page size as our value for the page size
|
|
87c18197
|
2016-03-16T19:05:11
|
|
Split the page size from the mmap alignment
While often similar, these are not the same on Windows. We want to use the page
size on Windows for the pools, but for mmap we need to use the allocation
granularity as the alignment.
On the other platforms these values remain the same.
|
|
059f33bf
|
2016-03-15T18:32:37
|
|
Option "LIBGIT2_PREFIX" to set the CMAKE's TARGET_PROPERTIES PREFIX
This is especially useful in combination with MinGW to yield the
Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"
|
|
08f030ce
|
2016-03-15T18:20:32
|
|
CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
This is useful to force "smart" IDEs (like CLIon) to use debug
flag -g even it may have decided that "-D_DEBUG" (which is
already present) is sufficient.
|
|
02d61a3b
|
2016-03-10T10:53:20
|
|
commit: add function to attach a signature to a commit
In combination with the function which creates a commit into a buffer,
this allows us to more easily create signed commits.
|
|
77394a27
|
2016-03-14T19:15:20
|
|
Merge pull request #3677 from pks-t/pks/coverity-fixes-round7
Coverity fixes round 7
|
|
4848dd32
|
2016-03-14T17:45:15
|
|
Merge pull request #3647 from pks-t/pks/coverity-fixes-round6
Coverity fixes round 6
|
|
fa31ee68
|
2016-03-14T15:00:59
|
|
Merge pull request #3671 from libgit2/cmn/remove-mingw32
Remove CI support for mingw32
|
|
ff5a3967
|
2016-03-14T15:29:30
|
|
Merge pull request #3683 from dbussink/dbussink/better-openssl-ciphers
Setup better defaults for OpenSSL ciphers
|
|
c577efbb
|
2016-03-14T12:41:41
|
|
Use general cl_git_fail because the error is generic
|
|
8f4cbc76
|
2016-03-14T12:41:12
|
|
Start error string with lower case character
|
|
fa72d6da
|
2016-03-14T12:02:00
|
|
Setup better defaults for OpenSSL ciphers
This ensures that when using OpenSSL a safe default set of ciphers
is selected. This is done so that the client communicates securely
and we don't accidentally enable unsafe ciphers like RC4, or even
worse some old export ciphers.
Implements the first part of https://github.com/libgit2/libgit2/issues/3682
|
|
b1093e62
|
2016-03-09T19:01:33
|
|
Remove CI support for mingw32
The tests have never run successfully and we do have successful builds
of mingw-w64, so remove these CI builds which do not add value.
|
|
1ddada42
|
2016-03-11T16:31:32
|
|
Merge pull request #3636 from nerdishbynature/fix-non-modular-header-in-module
Don't include inttypes if compiling for Mac/iOS
|
|
13c371dc
|
2016-03-10T17:21:02
|
|
config_cache: check return value of `git_config__lookup_entry`
Callers of `git_config__cvar` already handle the case where the
function returns an error due to a failed configuration variable
lookup, but we are actually swallowing errors when calling
`git_config__lookup_entry` inside of the function.
Fix this by returning early when `git_config__lookup_entry`
returns an error. As we call `git_config__lookup_entry` with
`no_errors == false` which leads us to call `get_entry` with
`GET_NO_MISSING` we will not return early when the lookup fails
due to a missing entry. Like this we are still able to set the
default value of the cvar and exit successfully.
|
|
6ff8a7c4
|
2016-03-10T17:05:30
|
|
filebuf: handle write error in `lock_file`
When writing to a file with locking not check if writing the
locked file actually succeeds. Fix the issue by returning error
code and message when writing fails.
|
|
836447e5
|
2016-03-10T16:52:09
|
|
config_file: handle error when trying to lock strmap
Accessing the current values map is handled through the
`refcounder_strmap_take` function, which first acquires a mutex
before accessing its values. While this assures everybody is
trying to access the values with the mutex only we do not check
if the locking actually succeeds.
Fix the issue by checking if acquiring the lock succeeds and
returning `NULL` if we encounter an error. Adjust callers.
|
|
e850e98d
|
2016-03-10T16:42:55
|
|
blame: handle error when resoling HEAD in normalize_options
When normalizing options we try to look up HEAD's OID. While this
action may fail in malformed repositories we never check the
return value of the function.
Fix the issue by converting `normalize_options` to actually
return an error and handle the error in `git_blame_file`.
|
|
8a4a343a
|
2016-03-10T16:33:49
|
|
blame_git: handle error returned by `git_commit_parent`
|
|
b27ccad2
|
2016-03-10T16:11:51
|
|
refdb_fs: fail if refcache returns NULL pointer
We usually check entries returned by `git_sortedcache_entry` for
NULL pointers. As we have a write lock in `packed_write`, though,
it really should not happen that the function returns NULL.
Assert that ref is not NULL to silence a Coverity warning.
|
|
2615d0d6
|
2016-03-02T01:50:34
|
|
coverity: report errors when uploading tarball
Curl by default does not report errors by setting the error code.
As the upload can fail through several conditions (e.g. the rate
limit, leading to unauthorized access) we should indicate this
information in Travis CI.
To improve upon the behavior, use `--write-out=%{http_code}` to
write out the HTTP code in addition to the received body and
return an error if the code does not equal 201.
|
|
1a8c11f4
|
2016-03-10T10:40:47
|
|
diff_tform: fix potential NULL pointer access
When the user passes in a diff which has no repository associated
we may call `git_config__get_int_force` with a NULL-pointer
configuration. Even though `git_config__get_int_force` is
designed to swallow errors, it is not intended to be called with
a NULL pointer configuration.
Fix the issue by only calling `git_config__get_int_force` only
when configuration could be retrieved from the repository.
|
|
486302d6
|
2016-03-01T19:11:33
|
|
submodule: avoid passing NULL pointers to strncmp
In C89 it is undefined behavior to pass `NULL` pointers to
`strncmp` and later on in C99 it has been explicitly stated that
functions with an argument declared as `size_t nmemb` specifying
the array length shall always have valid parameters, no matter if
`nmemb` is 0 or not (see ISO 9899 §7.21.1.2).
The function `str_equal_no_trailing_slash` always passes its
parameters to `strncmp` if their lengths match. This means if one
parameter is `NULL` and the other one either `NULL` or a string
with length 0 we will pass the pointers to `strncmp` and cause
undefined behavior.
Fix this by explicitly handling the case when both lengths are 0.
|
|
3fe5768b
|
2016-03-01T17:55:40
|
|
pack-objects: fix memory leak on overflow
|
|
80a834a5
|
2016-03-01T16:00:49
|
|
index: assert required OID are non-NULL
|
|
61d7328d
|
2016-03-01T15:35:45
|
|
object: avoid call of memset with ouf of bounds pointer
When computing a short OID we do this by first copying the
leading parts into the new OID structure and then setting the
trailing part to zero. In the case of the desired length being
`GIT_OID_HEXSZ - 1` we will call `memset` with an out of bounds
pointer and a length of 0. While this seems to cause no problems
for common platforms the C89 standard does not explicitly state
that calling `memset` with an out of bounds pointer and
length of 0 is valid.
Fix the potential issue by using the newly introduced
`git_oid__cpy_prefix` function.
|
|
35b7bca2
|
2016-03-11T09:58:38
|
|
tests: transport: fix memory leaks with registering transports
|
|
e756877d
|
2016-03-11T09:07:29
|
|
tests: nsec: correctly free nsec_path
git_buf_clear does not free allocated memory associated with a
git_buf. Use `git_buf_free` instead to correctly free its memory
and plug the memory leak.
|