|
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.
|
|
df25daef
|
2016-01-04T12:12:24
|
|
Added clar test for #3568
|
|
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.
|
|
6bcddf88
|
2016-03-16T17:14:36
|
|
iterator: test `advance_over` with a pathlist
|
|
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.
|
|
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.)
|
|
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.
|
|
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
|
|
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.
|
|
d051de24
|
2016-03-10T12:54:33
|
|
iterator: test fs iterator w/ many nested empty dirs
|
|
8a5a2e2f
|
2016-03-17T00:47:50
|
|
status: update test to include valid OID
|
|
661db4f4
|
2016-03-23T03:45:53
|
|
Merge pull request #3704 from ethomson/tree-reuse
tree: drop the now-unnecessary entries vector
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
c577efbb
|
2016-03-14T12:41:41
|
|
Use general cl_git_fail because the error is generic
|
|
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
|
|
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.
|
|
2ba9a0dd
|
2016-03-09T23:45:33
|
|
Merge pull request #3623 from ethomson/rebase_with_commit
rebase: additional setup tests of exotic behavior
|
|
9a786650
|
2016-03-09T11:00:27
|
|
odb: Handle corner cases in `git_odb_expand_ids`
The old implementation had two issues:
1. OIDs that were too short as to be ambiguous were not being handled
properly.
2. If the last OID to expand in the array was missing from the ODB, we
would leak a `GIT_ENOTFOUND` error code from the function.
|
|
c68044a8
|
2016-03-08T21:17:38
|
|
Merge pull request #3656 from ethomson/exists_prefixes
Introduce `git_odb_expand_ids`
|
|
62484f52
|
2016-03-08T14:09:55
|
|
git_odb_expand_ids: accept git_odb_expand_id array
Take (and write to) an array of a struct, `git_odb_expand_id`.
|
|
4b1f0f79
|
2016-03-08T11:44:21
|
|
git_odb_expand_ids: rename func, return the type
|
|
b7809b84
|
2016-03-08T13:38:55
|
|
Merge pull request #3555 from cbargren/ssh-git-protocols
Support for ssh+git and git+ssh protocols
|
|
534ca888
|
2016-03-08T13:35:11
|
|
Merge pull request #3652 from libgit2/cmn/commit-to-memory
commit: split creating the commit and writing it out
|
|
47cb42da
|
2016-03-03T22:56:02
|
|
commit: split creating the commit and writing it out
Sometimes you want to create a commit but not write it out to the
objectdb immediately. For these cases, provide a new function to
retrieve the buffer instead of having to go through the db.
|
|
eeff96c4
|
2016-03-08T10:43:33
|
|
Merge pull request #3655 from ethomson/nanosecond_defaults
Enable nanosecond resolution by default
|
|
53fb823b
|
2016-03-07T17:37:17
|
|
index::racy: force racy entry
Instead of hoping that we can get a racy entry by going real fast
and praying real hard, just create a racy entry.
|
|
565c4199
|
2016-03-07T17:04:32
|
|
index::nsec: don't expect shit filesystems to not suck
If the underlying filesystem doesn't support better than one
second resolution, then don't expect that turning on `GIT_USE_NSEC`
does anything magical to change that.
|
|
6c04269c
|
2016-03-04T00:50:35
|
|
git_odb_exists_many_prefixes: query odb for multiple short ids
Query the object database for multiple objects at a time, given their
object ID (which may be abbreviated) and optional type.
|
|
6abdf52d
|
2016-03-07T09:37:51
|
|
merge::workdir::dirty: update to use `st_ctime_nsec`
Update unit test to use newfangled `st_ctime_nsec`, which provides
indirection to the platform-correct name.
|
|
ea5bf6bb
|
2016-03-04T12:34:38
|
|
treebuilder: don't try to verify submodules exist in the odb
Submodules don't exist in the objectdb and the code is making us try to
look for a blob with its commit id, which is obviously not going to
work.
Skip the test if the user wants to insert a submodule.
|
|
e23efa6d
|
2016-03-03T21:03:10
|
|
tests: take the version from our define
|
|
9b3fc895
|
2016-03-03T11:17:36
|
|
tests: plug a leak
|
|
09d99680
|
2016-02-28T20:10:44
|
|
rebase: additional tests for completing a rebase
|
|
f2dddf52
|
2016-02-28T15:51:38
|
|
turn on strict object validation by default
|
|
4afe536b
|
2016-02-28T16:02:49
|
|
tests: use legitimate object ids
Use legitimate (existing) object IDs in tests so that we have the
ability to turn on strict object validation when running tests.
|
|
98c34149
|
2016-02-28T15:11:15
|
|
refs: honor strict object creation
|
|
6ddf533a
|
2016-02-23T18:29:16
|
|
git_index_add: validate objects in index entries (optionally)
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the index entries given to `git_index_add`.
|
|
2bbc7d3e
|
2016-02-23T15:00:27
|
|
treebuilder: validate tree entries (optionally)
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to treebuilder insertion.
|
|
ef63bab3
|
2016-02-23T13:34:35
|
|
git_commit: validate tree and parent ids
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to commit creation functions.
|
|
6cc4bac8
|
2016-02-28T11:31:10
|
|
Merge pull request #3577 from rossdylan/rossdylan/pooldebug
Add a new build flag to disable the pool allocator
|
|
a4c55069
|
2016-02-25T11:31:18
|
|
nsec: update staging test for GIT_USE_NSECS
The index::nsec::staging_maintains_other_nanos test was created to
ensure that when we stage an entry when GIT_USE_NSECS is *unset* that
we truncate the index entry and do not persist the (old, invalid)
nanosec values. Ensure that when GIT_USE_NSECS is *set* that we do
not do that, and actually write the correct nanosecond values.
|
|
7bab2e8f
|
2016-02-22T23:04:40
|
|
git_libgit2_opts: validate key
|
|
5663d4f6
|
2016-02-18T12:31:56
|
|
Merge pull request #3613 from ethomson/fixups
Remove most of the silly warnings
|
|
594a5d12
|
2016-02-18T12:28:06
|
|
Merge pull request #3619 from ethomson/win32_forbidden
win32: allow us to read indexes with forbidden paths on win32
|
|
2a39818c
|
2016-02-17T15:28:20
|
|
rebase: additional setup tests of exotic behavior
Test some additional exotic rebase setup behavior: that we are
able to set up properly when already in a detached HEAD state,
that the caller specifies all of branch, upstream and onto,
and that the caller specifies branch, upstream and onto by ID.
|
|
318b825e
|
2016-02-16T17:11:46
|
|
index: allow read of index w/ illegal entries
Allow `git_index_read` to handle reading existing indexes with
illegal entries. Allow the low-level `git_index_add` to add
properly formed `git_index_entry`s even if they contain paths
that would be illegal for the current filesystem (eg, `AUX`).
Continue to disallow `git_index_add_bypath` from adding entries
that are illegal universally illegal (eg, `.git`, `foo/../bar`).
|
|
4be2aa57
|
2016-02-16T18:50:08
|
|
win32: tests around handling forbidden paths
Introduce a repository that contains some paths that were illegal
on PC-DOS circa 1981 (like `aux`, `con`, `com1`) and that in a
bizarre fit of retrocomputing, remain illegal on some "modern"
computers, despite being "new technology".
Introduce some aspirational tests that suggest that we should be
able to cope with trees and indexes that contain paths that
would be illegal on the filesystem, so that we can at least diff
them. Further ensure that checkout will not write a repository
with forbidden paths.
|
|
eadd0f05
|
2016-02-16T14:06:48
|
|
commit: expose the different kinds of errors
We should be checking whether the object we're looking up is a commit,
and we should let the caller know whether the not-found return code
comes from a bad object type or just a missing signature.
|
|
0d9a39ea
|
2016-02-12T10:02:18
|
|
win32: drop incorrect `const`ness
|
|
f28bae0c
|
2016-02-15T17:16:00
|
|
rebase: persist a single in-memory index
When performing an in-memory rebase, keep a single index for the
duration, so that callers have the expected index lifecycle and
do not hold on to an index that is free'd out from under them.
|
|
35439f59
|
2016-02-11T12:24:21
|
|
win32: introduce p_timeval that isn't stupid
Windows defines `timeval` with `long`, which we cannot
sanely cope with. Instead, use a custom timeval struct.
|
|
5a296ad0
|
2016-02-12T00:55:20
|
|
Merge pull request #3610 from ethomson/rebase_bare
rebase: introduce bare rebasing
|
|
3679ebae
|
2016-02-11T23:37:52
|
|
Horrible fix for #3173.
|
|
460ae11f
|
2016-02-11T22:19:20
|
|
commit: don't forget the last header field
When we moved the logic to handle the first one, wrong loop logic was
kept in place which meant we still finished early. But we now notice it
because we're not reading past the last LF we find.
This was not noticed before as the last field in the tested commit was
multi-line which does not trigger the early break.
|
|
263e674e
|
2016-02-11T11:41:23
|
|
merge tests: correct casts
|
|
ad8aa112
|
2016-02-11T11:26:42
|
|
reset test: fix initialization warning
|
|
a202e0d4
|
2016-02-11T10:11:21
|
|
rebase: allow custom merge_options
Allow callers of rebase to specify custom merge options. This may
allow custom conflict resolution, or failing fast when conflicts
are detected.
|
|
ee667307
|
2016-02-11T10:48:48
|
|
rebase: introduce inmemory rebasing
Introduce the ability to rebase in-memory or in a bare repository.
When `rebase_options.inmemory` is specified, the resultant `git_rebase`
session will not be persisted to disk. Callers may still analyze
the rebase operations, resolve any conflicts against the in-memory
index and create the commits. Neither `HEAD` nor the working
directory will be updated during this process.
|
|
488e2b85
|
2016-02-09T16:26:58
|
|
Merge pull request #3599 from libgit2/gpgsign
Introduce git_commit_extract_signature
|
|
a65afb75
|
2016-02-08T18:51:13
|
|
Introduce git_commit_extract_signature
This returns the GPG signature for a commit and its contents without the
signature block, allowing for the verification of the commit's
signature.
|
|
f55eca16
|
2016-02-09T07:17:26
|
|
commit: also match the first header field when searching
We were searching only past the first header field, which meant we were
unable to find e.g. `tree` which is the first field.
While here, make sure to set an error message in case we cannot find the
field.
|
|
ed0571f8
|
2016-01-12T16:08:38
|
|
Add a new build flag to disable the pool allocator and pass all git_pool_malloc calls straight to git__malloc
|
|
1cc7f544
|
2015-12-28T11:35:19
|
|
Adding test cases that actually test the functionality of the new transport
ssh, ssh+git and git+ssh should all successfully build an SSH transport
|
|
62602547
|
2015-12-26T22:39:22
|
|
git_repository_init: include dotfiles when copying templates
Include dotfiles when copying template directory, which will handle
both a template directory itself that begins with a dotfile, and
any dotfiles inside the directory.
|
|
00282183
|
2015-12-26T22:32:17
|
|
repo::init tests: test a template dir with leading dot
Ensure that we can handle template directories that begin with a
leading dot.
|
|
5c042c5b
|
2015-12-26T22:06:45
|
|
repo::init tests: test init.templatedir setting
Ensure that `git_repository_init` honors the `init.templatedir`
configuration setting.
|
|
0c1f5672
|
2015-12-22T10:56:38
|
|
Adding spec coverage for ssh+git and git+ssh protocols
|
|
91f0d186
|
2015-12-21T20:49:14
|
|
typos in comments
|
|
5951445f
|
2015-12-17T10:13:04
|
|
commit: Fix memory leak in test suite
|
|
30c8e260
|
2015-12-14T13:53:26
|
|
Merge pull request #3521 from pks-t/blame-line-overflow
Line count overflow in git_blame_hunk and git_blame__entry
|
|
6aa06b65
|
2015-12-10T12:14:09
|
|
Merge pull request #3522 from pks-t/email-format-commit-message
diff: include commit message when formatting patch
|
|
465c3b38
|
2015-12-09T19:16:11
|
|
reset: perform the checkout before moving HEAD or the index
This keeps the state of the workdir the same as one from HEAD, removing
a source of possible confusion when calculating the work that is to be
done.
|
|
326c9fc2
|
2015-12-01T20:41:23
|
|
checkout test: Apply umask to file-mode test as well
Fix the file-mode test to expect system umask being applied to the
created file as well (it is currently applied to the directory only).
This fixes the test on systems where umask != 022.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
|
|
254e0a33
|
2015-11-24T13:43:43
|
|
diff: include commit message when formatting patch
When formatting a patch as email we do not include the commit's
message in the formatted patch output. Implement this and add a
test that verifies behavior.
|
|
7f8fe1d4
|
2015-12-01T10:03:56
|
|
commit: introduce `git_commit_body`
It is already possible to get a commit's summary with the
`git_commit_summary` function. It is not possible to get the
remaining part of the commit message, that is the commit
message's body.
Fix this by introducing a new function `git_commit_body`.
|
|
cb1cb24c
|
2015-11-24T10:18:58
|
|
blame: use size_t for line counts in git_blame_hunk
It is not unreasonable to have versioned files with a line count
exceeding 2^16. Upon blaming such files we fail to correctly keep
track of the lines as `git_blame_hunk` stores them in `uint16_t`
fields.
Fix this by converting the line fields of `git_blame_hunk` to
`size_t`. Add test to verify behavior.
|
|
a7bd157e
|
2015-11-30T17:40:49
|
|
tests: fix warning for nested struct initialization
|