tests-clar/checkout/index.c


Log

Author Commit Date CI Message
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).
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.
Vicent Martí ddcb28a4 2013-01-17T16:56:57 Merge pull request #1239 from ethomson/index_remove add an index_remove_bypath that removes conflicts
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
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 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.
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
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.
Ben Straub 9c05c17b 2012-10-19T20:05:18 Checkout progress now reports completed/total steps
Ben Straub 25e8b201 2012-10-18T15:35:03 Fix broken tests
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 2c8bbb27 2012-10-16T20:16:21 Convert checkout_index to use progress callback
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 c214fa1c 2012-09-06T15:15:46 checkout: segregate checkout strategies
nulltoken 020cda99 2012-09-14T16:45:24 checkout: separate tree from index related tests