summaryrefslogtreecommitdiff
path: root/tests-clar
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Some tests with ident and crlf filtersRussell Belfer2013-09-172-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the filter order to match core Git, too. This test demonstrates an interesting behavior of core Git (which is totally reasonable and which libgit2 matches, although mostly by coincidence). If you use the ident filter and commit a file with a garbage ident in it, like '$Id: this is just garbage$' and then immediately do a 'git checkout-index' with the new file, Git will not consider the file out of date and will not overwrite the file with an updated $Id$. Libgit2 has the same behavior. If you remove the file and then do a checkout-index, it will be replaced with a filtered version that has injected the OID correctly.
* | | Add clar helper to create new commit from indexRussell Belfer2013-09-1711-147/+93
| | | | | | | | | | | | | | | | | | | | | | | | There were a lot of places in the test code base that were creating a commit from the index on the current branch. This just adds a helper to handle that case pretty easily. There was only one test where this change ended up tweaking the test data, so pretty easy and mostly just a cleanup.
* | | Add clar helpers for testing file equalityRussell Belfer2013-09-174-69/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | These are a couple of new clar helpers for testing that a file has expected contents that I extracted from the checkout code. Actually wrote this as part of an abandoned earlier attempt at a new filters API, but it will be useful now for some of the tests I'm going to write.
* | | Fix cleanup issues with new testsRussell Belfer2013-09-171-1/+5
| | |
* | | Fixing up some win32 issues with autocrlfRussell Belfer2013-09-173-6/+6
| | |
* | | Make filter tests somewhat more robustRussell Belfer2013-09-172-3/+13
| | | | | | | | | | | | | | | | | | The global and system config could interfere with the filter tests by imposing CRLF filtering where it was not anticipated. This better isolates the tests from the system settings.
* | | Rearrange clar submodule cleanup codeRussell Belfer2013-09-175-13/+13
| | |
* | | Port tests from PR 1683Russell Belfer2013-09-174-56/+302
| | | | | | | | | | | | | | | | | | This ports over some of the tests from https://github.com/libgit2/libgit2/pull/1683 by @yorah and @ethomson
* | | Merge git_buf and git_bufferRussell Belfer2013-09-174-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
* | | Add ident filterRussell Belfer2013-09-173-3/+172
| | | | | | | | | | | | | | | | | | | | | This adds the ident filter (that knows how to replace $Id$) and tweaks the filter APIs and code so that git_filter_source objects actually have the updated OID of the object being filtered when it is a known value.
* | | Add functions to manipulate filter listsRussell Belfer2013-09-171-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | Extend the git2/sys/filter API with functions to look up a filter and add it manually to a filter list. This requires some trickery because the regular attribute lookups and checks are bypassed when this happens, but in the right hands, it will allow a user to have granular control over applying filters.
* | | Extend public filter api with filter listsRussell Belfer2013-09-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the git_filter_list into the public API so that users can create, apply, and dispose of filter lists. This allows more granular application of filters to user data outside of libgit2 internals. This also converts all the internal usage of filters to the public APIs along with a few small tweaks to make it easier to use the public git_buffer stuff alongside the internal git_buf.
* | | Add attributes to filters and fix registryRussell Belfer2013-09-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The filter registry as implemented was too primitive to actually work once multiple filters were coming into play. This expands the implementation of the registry to handle multiple prioritized filters correctly. Additionally, this adds an "attributes" field to a filter that makes it really really easy to implement filters that are based on one or more attribute values. The lookup and even simple value checking can all happen automatically without custom filter code. Lastly, with the registry improvements, this fills out the filter lifecycle callbacks, with initialize and shutdown callbacks that will be called before the filter is first used and after it is last invoked. This allows for system-wide initialization and cleanup by the filter.
* | | Create public filter object and use itRussell Belfer2013-09-171-6/+6
| | | | | | | | | | | | | | | | | | | | | This creates include/sys/filter.h with a basic definition of a git_filter and then converts the internal code to use it. There are related internal objects (git_filter_list) that we will want to publish at some point, but this is a first step.
* | | Start of filter API + git_blob_filtered_contentRussell Belfer2013-09-174-15/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This begins the process of exposing git_filter objects to the public API. This includes: * new public type and API for `git_buffer` through which an allocated buffer can be passed to the user * new API `git_blob_filtered_content` * make the git_filter type and GIT_FILTER_TO_... constants public
* | | Merge pull request #1833 from libgit2/cmn/config-includeVicent Martí2013-09-174-0/+128
|\ \ \ | | | | | | | | Support config includes
| * | | config: handle realloc issues from larger depthsCarlos Martín Nieto2013-09-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As the include depth increases, the chance of a realloc increases. This means that whenever we run git_array_alloc() or call config_parse(), we need to remember what our reader's index is so we can look it up again.
| * | | config: fix variable overridingCarlos Martín Nieto2013-09-072-0/+37
| | | | | | | | | | | | | | | | | | | | When two or more variables of the same name exist and the user asks for a scalar, we must return the latest value assign to it.
| * | | config: refresh included filesCarlos Martín Nieto2013-09-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | We need to refresh the variables from the included files if they are changed, so loop over all included files and re-parse the files if any of them has changed.
| * | | config: add support for include directivesCarlos Martín Nieto2013-09-073-0/+54
| | | | | | | | | | | | | | | | | | | | Relative, absolute and home-relative paths are supported. The recursion limit it set at 10, just like in git.
* | | | No such thing as an orphan branchCarlos Martín Nieto2013-09-1713-40/+40
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
* | | Add tests for git_tree_walkRussell Belfer2013-09-131-0/+74
| | | | | | | | | | | | This tests the fixes for issues from #1849
* | | clar: Move cl_assert_equal_sz() definition to clar.hnulltoken2013-09-122-2/+1
| | |
* | | clar: Fix clar__assert_equal error message formatingnulltoken2013-09-121-1/+1
| | |
* | | Merge pull request #1838 from libgit2/cmn/first-parentRussell Belfer2013-09-101-0/+51
|\ \ \ | | | | | | | | revwalk: allow simplifying by first-parent
| * | | revwalk: allow simplifying by first-parentCarlos Martín Nieto2013-09-091-0/+51
| | | | | | | | | | | | | | | | | | | | When enabled, only the first parent of each commit will be queued, enabling a simple way of using first-parent simplification.
* | | | odb: Teach loose backend to return EAMBIGUOUSnulltoken2013-09-101-0/+31
| | | |
* | | | odb: Error when streaming in too [few|many] bytesnulltoken2013-09-071-0/+56
|/ / /
* | | Merge pull request #1836 from libgit2/ntk/fix/leaksVicent Martí2013-09-071-0/+2
|\ \ \ | | | | | | | | Fix memory leaks
| * | | tests: Fix memory leaksnulltoken2013-09-071-0/+2
| | | |
* | | | revparse: Prevent unnecessary odb backend callsnulltoken2013-09-071-0/+13
|/ / /
* | | odb: Prevent stream_finalize_write() from overwritingnulltoken2013-09-061-0/+28
| | | | | | | | | | | | | | | | | | Now that #1785 is merged, git_odb_stream_finalize_write() calculates the object id before invoking the odb backend. This commit gives a chance to the backend to check if it already knows this object.
* | | blob: Slightly enforce a create_fromchunks() testnulltoken2013-09-061-1/+5
| | |
* | | Better macro name for is-exec-bit-set testRussell Belfer2013-09-052-2/+2
| | |
* | | GIT_MODE_TYPE should exclude setgid bitsRussell Belfer2013-09-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The GIT_MODE_TYPE macro was looking at all bits above the permissions, but it should really just look at the top bits so that it will give the right results for a setgid or setuid entry. Since we're now using these macros in the tests, this was causing a test failure on platforms that don't support setgid.
* | | Fix tests of file modesRussell Belfer2013-09-053-18/+24
| | | | | | | | | | | | | | | | | | | | | This fixes an issue checking file modes in the tests that initialize a repo from a template directory when a symlink is used in the template. Also, this updates some other places where we are examining file modes to use the new macros.
* | | Fix some newer GCC compiler warningsRussell Belfer2013-09-053-6/+3
| | |
* | | Fix tests to use core.filemode correctlyRussell Belfer2013-09-043-13/+20
| | | | | | | | | | | | Some windows tests were failing
* | | _umask is function name on WindowsRussell Belfer2013-09-041-5/+5
| | |
* | | Clean up one other mode_t assertionRussell Belfer2013-09-041-2/+2
| | |
* | | Make tests take umask into accountRussell Belfer2013-09-043-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | It seems that libgit2 is correctly applying the umask when initializing a repository from a template and when creating new directories during checkout, but the test suite is not accounting for possible variations due to the umask. This updates that so that the test suite will work regardless of the umask.
* | | Update clarRussell Belfer2013-09-045-59/+117
|/ /
* | Test pushing to remotes with "file:///" urlsBen Straub2013-09-041-1/+70
| |
* | Merge pull request #1817 from libgit2/ntk/fix/backend/honor_refresh_capabilitiesVicent Martí2013-09-041-0/+261
|\ \ | | | | | | Of backends and refreshers...
| * | odb: Honor the non refreshing capability of a backendnulltoken2013-08-301-0/+261
| | |
* | | Fix resolving relative windows network pathsRussell Belfer2013-09-031-1/+15
| | |
* | | don't use inline in tests for win32Russell Belfer2013-09-031-1/+2
| | |
* | | Merge pull request #1804 from ethomson/rewritesVicent Martí2013-09-032-0/+90
|\ \ \ | | | | | | | | Minor changes for rewrites
| * | | Split rewrites, status doesn't return rewritesEdward Thomson2013-08-282-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that we apply splits to rewrites, even if we're not interested in examining it closely for rename/copy detection. In keeping with core git, status should not display rewrites, it should simply show files as "modified".
* | | | path: properly resolve relative pathsNikolai Vladimirov2013-09-031-5/+93
| | | |