summaryrefslogtreecommitdiff
path: root/tests-clar/checkout/index.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-141-620/+0
|
* More cleanups to remove WIN assumptionsRussell Belfer2013-10-031-4/+6
| | | | | This cleans up more of the test suite to check actual filesystem behavior instead of relying on Windows vs. Mac vs. Linux to test.
* Fix tests of file modesRussell Belfer2013-09-051-1/+1
| | | | | | | 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-051-1/+1
|
* Make tests take umask into accountRussell Belfer2013-09-041-3/+7
| | | | | | | | 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.
* test: Fix memory leaknulltoken2013-06-291-0/+2
|
* Fix checkout tests on WindowsRussell Belfer2013-06-241-3/+8
|
* Addition checkout target directory testsRussell Belfer2013-06-211-0/+71
| | | | | This adds additonal tests of the checkout target directory option including using it to dump data from bare repos.
* Add target directory to checkoutRussell Belfer2013-06-211-0/+28
| | | | | | | | | | | | | | | | 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
* Reorganize diff and add basic diff driverRussell Belfer2013-06-101-0/+1
| | | | | | | | | | | | | | | | | | 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.
* Fix up checkout file contents checksRussell Belfer2013-03-251-21/+21
| | | | | | | | | | | | 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).
* Test fixes and cleanupRussell Belfer2013-03-251-1/+1
| | | | | | | | 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).
* Added some tests for issue #1397Sven Strickroth2013-03-251-0/+17
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Add cl_repo_set_bool and cleanup testsRussell Belfer2013-03-221-25/+5
| | | | | | 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.
* Merge pull request #1239 from ethomson/index_removeVicent Martí2013-01-171-2/+2
|\ | | | | add an index_remove_bypath that removes conflicts
| * add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson2013-01-121-2/+2
| | | | | | | | to match
* | checkout: Teach checkout to cope with orphaned Headnulltoken2013-01-131-0/+10
|/ | | | Fix #1236
* Actually fix win32 checkout testRussell Belfer2013-01-041-4/+12
| | | | | | 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...
* Fix crlf issue with checkout testsRussell Belfer2013-01-041-32/+1
| | | | | Move some checkout utility functions into a shared file and fix some crlf filtering issues when verifying file contents.
* Fix checkout of index-only dirs and prefixed pathsRussell Belfer2013-01-041-0/+25
| | | | | | | | | | | 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.
* More checkout improvementsRussell Belfer2013-01-041-82/+105
| | | | | | | 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.
* Rework checkout internals (again)Russell Belfer2013-01-041-37/+66
| | | | | | | | | | | | | | | | 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.
* Deploy GIT_INIT_STRUCTUREBen Straub2012-11-301-3/+2
|
* Deploy GIT_CHECKOUT_OPTS_INITBen Straub2012-11-301-2/+21
|
* Rename ref and reflog apis for consistencyBen Straub2012-11-271-1/+1
|
* Add explicit git_index ptr to diff and checkoutRussell Belfer2012-11-141-20/+20
| | | | | | | | 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.
* Rework checkout with new strategy optionsRussell Belfer2012-11-091-28/+46
| | | | | | | | | | | | | | | | | | 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.
* Fix checkout behavior when its hands are tiedRussell Belfer2012-11-091-1/+32
| | | | | | | | | | | | | | | | | | | | 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.
* Fix Windows buildBen Straub2012-10-251-1/+1
| | | | Pedantic ordering of GIT_UNUSED vs. variable declarations.
* Checkout progress now reports completed/total stepsBen Straub2012-10-191-2/+2
|
* Fix broken testsBen Straub2012-10-191-5/+5
|
* index: remove read_tree() progress indicatornulltoken2012-10-191-1/+1
| | | | | | | | 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.
* Convert checkout_index to use progress callbackBen Straub2012-10-191-17/+34
|
* checkout: add notification callback for skipped filesnulltoken2012-09-211-0/+73
|
* checkout: Mimic git_diff_options storage of pathsnulltoken2012-09-171-4/+2
|
* checkout: segregate checkout strategiesnulltoken2012-09-171-10/+28
|
* checkout: separate tree from index related testsnulltoken2012-09-171-0/+273