Commit Graph

9561 Commits

Author SHA1 Message Date
Carlos Martín Nieto
2f0450f4d6 Merge pull request #3712 from ethomson/config_duplicate_section
config: don't write duplicate section
2016-03-29 03:26:43 -07:00
Edward Thomson
b085ecbe09 Merge pull request #3703 from libgit2/cmn/multivar-set-locked
config: don't special-case multivars that don't exist yet
2016-03-28 13:51:21 -04:00
Edward Thomson
76e1a679ea config::write::repeated: init our buffer 2016-03-28 08:56:13 -07:00
Edward Thomson
e25e1ca1b2 config: don't write section header if we're in it
If we hit the EOF while trying to write a new value, it may be that
we're already in the section that we were looking for.  If so, do not
write a (duplicate) section header, just write the value.
2016-03-28 11:13:51 -04:00
Carlos Martín Nieto
3e95bd36d9 config: show we write a spurious duplicated section header
We should notice that we are in the correct section to add. This is a
cosmetic bug, since replacing any of these settings does work.
2016-03-28 10:47:14 -04:00
Edward Thomson
e89abec69f Merge pull request #3708 from sschuberth/master
CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P
2016-03-28 09:50:31 -04:00
Carlos Martín Nieto
7b29be31c2 Merge pull request #3691 from ethomson/iterators
Some FANTASTIC iterator refactoring
2016-03-26 05:39:07 -07:00
Marc Strapetz
d6713ec64e iterator: comment fixed 2016-03-24 15:59:49 -04:00
Marc Strapetz
f4777058d0 iterator: unused includes removed 2016-03-24 15:59:49 -04:00
Marc Strapetz
c017c18361 iterator: new workdir-iterator test for pathlist + includings trees 2016-03-24 15:59:49 -04:00
Marc Strapetz
09064f15c5 iterator: new index-iterator test for pathlist + includings trees 2016-03-24 15:59:49 -04:00
Marc Strapetz
8152a74821 iterator: more pathlist-related tests should test actual paths 2016-03-24 15:59:49 -04:00
Edward Thomson
9eb9e5fa87 iterator: cleanups
Remove some unused functions, refactor some ugliness.
2016-03-24 15:59:49 -04:00
Edward Thomson
d712c2b27f iterator: don't run the gunk test by default on CI
(It's slow!)
2016-03-24 15:59:48 -04:00
Edward Thomson
35877463fd iterator: refactor empty iterator to new style 2016-03-24 15:59:48 -04:00
Edward Thomson
247e3b4305 iterator: mandate advance_over
Since the three iterators implement `advance_over` differently,
mandate it and implement each.
2016-03-24 15:59:48 -04:00
Edward Thomson
0ef0b71ca5 iterator: refactor index iterator 2016-03-24 15:59:48 -04:00
Edward Thomson
ba6f86eb2e Introduce git_path_common_dirlen 2016-03-24 15:59:48 -04:00
Edward Thomson
82a1aab647 iterator: move the index into the iterator itself 2016-03-24 15:59:48 -04:00
Edward Thomson
de034cd239 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.
2016-03-24 15:59:48 -04:00
Carlos Martín Nieto
d4763c9861 Merge pull request #3574 from chescock/buffer-sideband-pack-data
Buffer sideband packet data
2016-03-24 06:56:25 -07:00
Sebastian Schuberth
035430b7f3 CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P 2016-03-24 14:10:29 +01:00
Jeff Hostetler
df25daef9b Added clar test for #3568 2016-03-23 17:17:02 -04:00
Edward Thomson
6788553231 diff: stop processing nitem when its removed
When a directory is removed out from underneath us, stop trying to
manipulate it.
2016-03-23 17:17:02 -04:00
Edward Thomson
0a2e10328a 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.
2016-03-23 17:17:02 -04:00
Edward Thomson
6cd9573f54 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.
2016-03-23 17:17:02 -04:00
joshaber
b620426006 Failing test. 2016-03-23 17:17:02 -04:00
Marc Strapetz
ae86aa5a68 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.
2016-03-23 17:16:38 -04:00
Edward Thomson
6bcddf88b3 iterator: test advance_over with a pathlist 2016-03-23 17:16:38 -04:00
Edward Thomson
9fb2527f3c iterator: add tests for advance_over
`git_iterator_advance_over` is a gnarly bit of code with no actual
tests.
2016-03-23 17:16:37 -04:00
Edward Thomson
85541f4390 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.
2016-03-23 17:16:37 -04:00
Edward Thomson
908d8de8c3 iterator: workdir tests with submodules
Ensure that when specifying start/end paths, or pathlists, that we
deal correctly with submodules.
2016-03-23 17:16:37 -04:00
Edward Thomson
c3d195f1d9 iterator: expand workdir tests with pathlist
Expand the workdir tests to validate the paths in case sensitive
and insensitive tests.
2016-03-23 17:16:37 -04:00
Edward Thomson
4c88198a85 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.)
2016-03-23 17:16:37 -04:00
Edward Thomson
0e0589fcc3 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.
2016-03-23 17:16:37 -04:00
Edward Thomson
d051de243c iterator: test fs iterator w/ many nested empty dirs 2016-03-23 17:08:37 -04:00
Edward Thomson
a4f520a6f6 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.
2016-03-23 17:08:37 -04:00
Edward Thomson
702b23d7c4 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.
2016-03-23 17:08:37 -04:00
Edward Thomson
be30387e8b 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.)
2016-03-23 17:08:37 -04:00
Edward Thomson
277c85eb1c repo::iterator: don't go out of bounds 2016-03-23 17:08:37 -04:00
Edward Thomson
f0224772ee git_object_dup: introduce typesafe versions 2016-03-23 17:08:37 -04:00
Edward Thomson
684b35c41b 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.
2016-03-23 17:08:37 -04:00
Edward Thomson
ac05086c40 iterator: drop unused/unimplemented seek 2016-03-23 17:08:36 -04:00
Edward Thomson
8a5a2e2f0e status: update test to include valid OID 2016-03-23 17:08:36 -04:00
Edward Thomson
63f7b7f929 Merge pull request #3707 from sschuberth/master
CMakeLists: Show the pointer size for an unsupported architecture
2016-03-23 13:14:04 -07:00
Sebastian Schuberth
f9601e6f32 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.
2016-03-23 20:37:39 +01:00
Carlos Martín Nieto
1a2d8bd3c2 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.
2016-03-23 16:51:52 +01:00
Carlos Martín Nieto
661db4f482 Merge pull request #3704 from ethomson/tree-reuse
tree: drop the now-unnecessary entries vector
2016-03-23 03:45:53 -07:00
Carlos Martín Nieto
0a7ce4992d Merge pull request #3502 from libgit2/cmn/createblob-stream
Add ability to write a filtered blob through a stream
2016-03-22 14:34:35 -07:00
Carlos Martín Nieto
6669e3e839 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.
2016-03-22 20:00:25 +01:00