tests-clar/checkout


Log

Author Commit Date CI Message
Russell Belfer eab3746b 2013-09-15T22:23:39 More filtering tests including order This adds more tests of filters, including the ident filter when mixed with custom filters. I was able to combine with the reverse filter and demonstrate that the order of filter application with the default priority constants matches the order of core Git. Also, this fixes two issues in the ident filter: preventing ident expansion on binary files and avoiding a NULL dereference when dollar sign characters are found without Id.
Russell Belfer 37f9e409 2013-09-13T21:43:00 Some tests with ident and crlf filters 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.
Russell Belfer 13f36ffb 2013-09-13T16:30:21 Add clar helpers for testing file equality 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.
Russell Belfer 0cf77103 2013-08-26T23:17:07 Start of filter API + git_blob_filtered_content 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
Carlos Martín Nieto 605da51a 2013-09-17T09:50:30 No such thing as an orphan branch 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.
Russell Belfer c97d407d 2013-09-05T11:45:29 Fix tests of file modes 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.
Russell Belfer 27061b15 2013-09-05T10:25:16 Fix some newer GCC compiler warnings
Russell Belfer 780f3e54 2013-09-04T16:13:18 Make tests take umask into account 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.
Russell Belfer cf94024c 2013-09-04T11:42:48 Update clar
Ben Straub 75f98a95 2013-08-07T06:12:27 Add checkout test for long file name
nulltoken d90390c1 2013-06-29T13:38:27 test: Fix memory leak
Russell Belfer f3f4c6b5 2013-06-24T11:56:35 Fix checkout tests on Windows
Russell Belfer d4f98ba4 2013-06-21T12:29:03 Addition checkout target directory tests This adds additonal tests of the checkout target directory option including using it to dump data from bare repos.
Russell Belfer 9094ae5a 2013-06-21T11:51:16 Add target directory to checkout This adds the ability for checkout to write to a target directory instead of having to use the working directory of the repository. This makes it easier to do exports of repository data and the like. This is similar to, but not quite the same as, the --prefix option to `git checkout-index` (this will always be treated as a directory name, not just as a simple text prefix). As part of this, the workdir iterator was extended to take the path to the working directory as a parameter and fallback on the git_repository_workdir result only if it's not specified. Fixes #1332
Russell Belfer 36fd9e30 2013-06-21T11:20:54 Fix checkout of modified file when missing from wd This fixes the checkout case when a file is modified between the baseline and the target and yet missing in the working directory. The logic for that case appears to have been wrong. This also adds a useful checkout notify callback to the checkout test helpers that will count notifications and also has a debug mode to visualize what checkout thinks that it's doing.
Edward Thomson dacce80b 2013-06-20T19:05:38 test asserting checkout should not recreate deleted files
Russell Belfer 114f5a6c 2013-06-10T10:10:39 Reorganize diff and add basic diff driver This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
nulltoken 1fed6b07 2013-05-13T21:57:37 Fix trailing whitespaces
Edward Thomson e09d18ee 2013-05-03T18:39:44 allow checkout to proceed when a dir to be removed is in use (win32)
Edward Thomson 0cc7d8df 2013-05-01T09:50:40 allow empty dirs to exist when doing checkout
Edward Thomson 8023b83a 2013-04-17T17:21:17 use a longer string for dummy data in test to avoid conflicting w/ index
Ben Straub 2ebc3c66 2013-04-15T11:57:24 Redeploy git_revparse_single.
Ben Straub 1aa21fe3 2013-04-09T05:03:51 Deprecate git_revparse_single and _rangelike
Russell Belfer 050ab995 2013-03-25T14:13:53 Fix up checkout file contents checks This fixes of the file contents checks in checkout to give slightly better error messages by directly calling the underlying clar assertions so the file and line number of the top level call can be reported correctly, and renames the helpers to not start with "test_" since that is kind of reserved by clar. This also enables some of the CRLF tests on all platforms that were previously Windows only (by pushing a check of the native line endings into the test body).
Edward Thomson 4a15ea86 2013-03-21T14:02:25 don't convert CRLF to CRCRLF
Russell Belfer 1098cfae 2013-03-22T14:52:29 Test fixes and cleanup This fixes some places where the new tests were leaving the test area in a bad state or were freeing data they should not free. It also removes code that is extraneous to the core issue and fixes an invalid SHA being looked up in one of the tests (which was failing, but for the wrong reason).
Sven Strickroth b8acb775 2013-03-07T22:15:40 Added some tests for issue #1397 Signed-off-by: Sven Strickroth <email@cs-ware.de>
Russell Belfer 1323c6d1 2013-03-22T14:27:56 Add cl_repo_set_bool and cleanup tests This adds a helper function for the cases where you want to quickly set a single boolean config value for a repository. This allowed me to remove a lot of code.
Edward Thomson 395509ff 2013-02-27T14:47:39 don't dereference at the end of the workdir iterator
nulltoken d96aa8a9 2013-01-20T18:24:54 tests: Remove useless code
Philip Kelley cfc39f50 2013-01-25T22:43:52 Fix 3 memory leaks
Michael Schubert 26ec6a6d 2013-01-24T20:38:01 tests-clar: ifdef GIT_WIN32 win helper functions
Vicent Martí ddcb28a4 2013-01-17T16:56:57 Merge pull request #1239 from ethomson/index_remove add an index_remove_bypath that removes conflicts
Edward Thomson 271680d7 2013-01-17T18:18:44 add a git config, don't run crlf tests on non-win32
Edward Thomson 6e959708 2013-01-17T13:11:57 cache should contain on-disk (filtered) file size
nulltoken 5b524d69 2013-01-12T19:37:14 Fix Travis compilation warnings
nulltoken 2a3b3e03 2013-01-12T19:27:31 checkout: Teach checkout to cope with orphaned Head Fix #1236
Edward Thomson 25743bd7 2013-01-12T13:47:56 add an index_remove_bypath that removes conflicts, renamed add_from_workdir to match
Carlos Martín Nieto 0b3aa7be 2013-01-12T19:01:45 tests: plug leaks
Philip Kelley 359316b5 2013-01-11T17:16:55 Merge pull request #1215 from phkelley/binaryunicode Add a failing test for CRLF filters
nulltoken 4a0ac175 2013-01-10T23:27:13 checkout: Deploy EMERGECONFLICT usage
nulltoken cce2f16b 2013-01-10T12:32:20 Fix indentations
Russell Belfer 40342bd2 2013-01-10T15:15:37 Add GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH This adds an option to checkout a la the diff option to turn off fnmatch evaluation for pathspec entries. This can be useful to make sure your "pattern" in really interpretted as an exact file match only.
Philip Kelley fcc48d1f 2013-01-09T12:37:22 Add a failing test for autocrlf filters
nulltoken b97fabfa 2013-01-06T15:18:00 tests: Fix some memory leaks
Russell Belfer 2f089539 2013-01-04T17:17:37 Actually fix win32 checkout test It turns out that using REMOVE_UNTRACKED with checkout for this particular test was causing the .gitattributes file to be removed and so we do have to allow for the CRs in the created file...
Russell Belfer bebdbcd4 2013-01-04T16:56:21 Fix crlf issue with checkout tests Move some checkout utility functions into a shared file and fix some crlf filtering issues when verifying file contents.
Russell Belfer 817d6251 2013-01-03T16:56:27 Fix checkout of index-only dirs and prefixed paths There are a couple of checkout bugs fixed here. One is with untracked working directory entries that are prefixes of tree entries but not in a meaningful way (i.e. "read" is a prefix of "readme.txt" but doesn't interfere in any way). The second bug is actually a redo of 07edfa0fc640f85f95507c3101e77accd7d2bf0d where directory entries in the index that are not in the diff were not being removed correctly. That fix remedied one case but broke another.
Russell Belfer d8889d2b 2013-01-03T14:08:53 Fix checkout bug rmv untracked trees from index When checking out with the GIT_CHECKOUT_REMOVE_UNTRACKED option and there was an entire tree in the working directory and in the index that is not in the baseline nor target commit, the tree was correctly(?) removed from the working directory but was not successfully removed from the index. This fixes that and adds a test of the functionality.
Russell Belfer 0d70f650 2013-01-03T10:51:18 Fixing checkout UPDATE_ONLY and adding tests This adds a bunch of new checkout tests and in the process I found a bug in the GIT_CHECKOUT_UPDATE_ONLY flag which I fixed.
Russell Belfer c50c58de 2013-01-02T17:10:56 Extend tests for checkout with typechanges Test a number of other cases, including intentionally forced conflicts and deeper inspection that trees get created properly. There is a still a bug in checkout because the first test here (i.e. test_checkout_typechange__checkout_typechanges_safe) should be able to pass with GIT_CHECKOUT_SAFE as a strategy, but it will not because of some lingering submodule checkout issues.
Russell Belfer 5cf9875a 2012-12-18T15:19:24 Add index updating to checkout Make checkout update entries in the index for all files that are updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX is given. To do this, iterators were extended to allow a little more introspection into the index being iterated over, etc.
Russell Belfer 7e5c8a5b 2012-12-10T15:31:43 More checkout improvements This flips checkout back to be driven off the changes between the baseline and the target trees. This reinstates the complex code for tracking the contents of the working directory, but overall, I think the resulting logic is easier to follow.
Russell Belfer cf208031 2012-12-06T13:36:17 Rework checkout internals (again) I've tried to map out the detailed behaviors of checkout and make sure that we're handling the various cases correctly, along with providing options to allow us to emulate "git checkout" and "git checkout-index" with the various flags. I've thrown away flags in the checkout API that seemed like clutter and added some new ones. Also, I've converted the conflict callback to a general notification callback so we can emulate "git checkout" output and display "dirty" files. As of this commit, the new behavior is not working 100% but some of that is probably baked into tests that are not testing the right thing. This is a decent snapshot point, I think, along the way to getting the update done.
Jameson Miller c5df10f4 2012-11-30T10:59:03 Failing test on git_checkout_tree when removing directories
Marvin Gülker d0951175 2012-12-06T16:12:21 Add failing test to demonstrate wrong checkout behaviour
Ben Straub 0ab3a2ab 2012-11-30T20:34:50 Deploy GIT_INIT_STRUCTURE
Ben Straub b81aa2f1 2012-11-29T14:06:40 Deploy GIT_CHECKOUT_OPTS_INIT
Ben Straub 2508cc66 2012-11-18T21:38:08 Rename ref and reflog apis for consistency
Sascha Cunz 9094d30b 2012-11-23T11:41:56 Reset all static variables to NULL in clar's __cleanup Without this change, any failed assertion in the second (or a later) test inside a test suite has a chance of double deleting memory, resulting in a heap corruption. See #1096 for details. This leaves alone the test cases where we "just" use cl_git_sandbox_init() and cl_git_sandbox_cleanup(). These methods already take good care to not double delete a repository. Fixes #1096
Russell Belfer bbe6dbec 2012-11-14T23:29:48 Add explicit git_index ptr to diff and checkout A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
Russell Belfer ad9a921b 2012-11-08T17:05:07 Rework checkout with new strategy options This is a major reworking of checkout strategy options. The checkout code is now sensitive to the contents of the HEAD tree and the new options allow you to update the working tree so that it will match the index content only when it previously matched the contents of the HEAD. This allows you to, for example, to distinguish between removing files that are in the HEAD but not in the index, vs just removing all untracked files. Because of various corner cases that arise, etc., this required some additional capabilities in rmdir and other utility functions. This includes the beginnings of an implementation of code to read a partial tree into the index based on a pathspec, but that is not enabled because of the possibility of creating conflicting index entries.
Russell Belfer 32def5af 2012-10-24T17:37:07 Fix checkout behavior when its hands are tied So, @nulltoken created a failing test case for checkout that proved to be particularly daunting. If checkout is given only a very limited strategy mask (e.g. just GIT_CHECKOUT_CREATE_MISSING) then it is possible for typechange/rename modifications to leave it unable to complete the request. That's okay, but the existing code did not have enough information not to generate an error (at least for tree/blob conflicts). This led me to a significant reorganization of the code to handle the failing case, but it has three benefits: 1. The test case is handled correctly (I think) 2. The new code should actually be much faster than the old code since I decided to make checkout aware of diff list internals. 3. The progress value accuracy is hugely increased since I added a fourth pass which calculates exactly what work needs to be done before doing anything.
Ben Straub 1fc375e6 2012-10-25T09:02:55 Fix Windows build Pedantic ordering of GIT_UNUSED vs. variable declarations.
Vicent Martí 1eb8cd7f 2012-10-25T08:16:13 Merge pull request #990 from ben/clone-callbacks Progress callbacks
nulltoken cd1ef822 2012-10-20T12:07:53 test: extract make_head_orphaned() logic
Ben Straub 9c05c17b 2012-10-19T20:05:18 Checkout progress now reports completed/total steps
Ben Straub cd001bbb 2012-10-19T19:37:47 Fix from rebase
Ben Straub 25e8b201 2012-10-18T15:35:03 Fix broken tests
Ben Straub 30a46ab1 2012-10-18T14:04:14 Adjust for rebase
nulltoken 0ae81fc4 2012-10-17T15:30:22 index: remove read_tree() progress indicator git_index_read_tree() was exposing a parameter to provide the user with a progress indicator. Unfortunately, due to the recursive nature of the tree walk, the maximum number of items to process was unknown. Thus, the indicator was only counting processed entries, without providing any information how the number of remaining items.
Ben Straub 80642656 2012-10-16T20:23:10 Convert checkout_* to use progress callback
Ben Straub 2c8bbb27 2012-10-16T20:16:21 Convert checkout_index to use progress callback
nulltoken 8b05bea8 2012-10-19T17:07:39 errors: deploy GIT_EORPHANEDHEAD usage
Russell Belfer 0d64bef9 2012-10-05T15:56:57 Add complex checkout test and then fix checkout This started as a complex new test for checkout going through the "typechanges" test repository, but that revealed numerous issues with checkout, including: * complete failure with submodules * failure to create blobs with exec bits * problems when replacing a tree with a blob because the tree "example/" sorts after the blob "example" so the delete was being processed after the single file blob was created This fixes most of those problems and includes a number of other minor changes that made it easier to do that, including improving the TYPECHANGE support in diff/status, etc.
nulltoken 9e592583 2012-09-19T12:23:47 checkout: add notification callback for skipped files
nulltoken 39783719 2012-09-17T20:27:28 checkout: Mimic git_diff_options storage of paths
nulltoken 10df95c3 2012-09-15T12:23:49 checkout: add test coverage of dirs and subtrees
nulltoken c214fa1c 2012-09-06T15:15:46 checkout: segregate checkout strategies
nulltoken 020cda99 2012-09-14T16:45:24 checkout: separate tree from index related tests
nulltoken 3aa443a9 2012-08-20T16:56:45 checkout: introduce git_checkout_tree()
Russell Belfer e9ca852e 2012-08-23T09:20:17 Fix warnings and merge issues on Win64
Ben Straub b2be351a 2012-08-21T10:10:32 Win32: test core.autocrlf
Ben Straub c3588142 2012-08-20T20:24:20 Tests: close file handles before asserting Avoids getting ERROR_SHARING_VIOLATION on win32 and killing the entire clar run.
Ben Straub eb87800a 2012-08-06T09:34:17 Checkout: fix memory leak in tests.
Ben Straub 5f4d2f9f 2012-07-31T19:49:19 Checkout: fix problem with detached HEAD.
Ben Straub 78cd966a 2012-07-31T16:24:04 Checkout: fix crlf tests under win32.
Ben Straub e4bac3c4 2012-07-31T15:38:12 Checkout: crlf filter.
Ben Straub 8e4aae1a 2012-07-31T10:44:42 Checkout: handle file modes properly. Global file mode override now works properly with the file mode stored in the tree node.
Ben Straub 3f584b50 2012-07-31T09:01:11 Try to fix Travis.
Ben Straub e0681f6d 2012-07-27T20:39:43 Checkout: disable file-mode test on win32.
Ben Straub b31667fb 2012-07-27T20:29:06 Checkout: add head- and ref-centric checkouts. Renamed git_checkout_index to what it really was, and removed duplicate code from clone.c. Added git_checkout_ref, which updates HEAD and hands off to git_checkout_head. Added tests for the options the caller can pass to git_checkout_*.
Ben Straub b401bace 2012-07-26T13:12:21 Restructure for better checkout options * Removed the #define for defaults * Promoted progress structure to top-level API call argument
Ben Straub ef9905c9 2012-07-26T12:58:44 checkout: introduce git_checkout_opts Refactor checkout into several more-sensible entry points, which consolidates common options into a single structure that may be passed around.
Ben Straub 09a03995 2012-07-17T20:20:34 Checkout: make core.symlinks test work on OSX.
Ben Straub 8651c10f 2012-07-17T19:57:37 Checkout: obey core.symlinks.
Ben Straub 1d68fcd0 2012-07-16T16:16:11 Checkout: handle symlinks. Includes unfinished win32 implementation.
Ben Straub 71bc89b9 2012-07-13T20:24:40 Disable test that aren't quite ready yet.
Ben Straub 280c7bbf 2012-07-13T15:52:27 Add checkout test suite. Removed 'bare' option from test repository to allow checkout tests.