summaryrefslogtreecommitdiff
path: root/tests-clar/checkout
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-149-3239/+0
|
* Make diff and status perform soft index reloadRussell Belfer2013-11-011-1/+0
| | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
* clar: Fix warnings in GCC/Linuxvmg/gcc-warningsVicent Marti2013-11-011-0/+3
|
* Two-step conflict checkout (load / perform)Edward Thomson2013-10-161-0/+100
| | | | | | | Move conflict handling into two steps: load the conflicts and then apply the conflicts. This is more compatible with the existing checkout implementation and makes progress reporting more sane.
* Honor UPDATE_ONLY bit when checking out conflictsEdward Thomson2013-10-161-1/+49
|
* Don't overwrite ~ files checking out conflictsEdward Thomson2013-10-161-0/+140
| | | | | | | | If a D/F conflict or rename 2->1 conflict occurs, we write the file sides as filename~branchname. If a file with that name already exists in the working directory, write as filename~branchname_0 instead. (Incrementing 0 until a unique filename is found.)
* checkout rename conflictsEdward Thomson2013-10-161-1/+377
| | | | | rename conflict tests for checkout conflicts, don't suffix filenames when checking out with USE_OURS or USE_THEIRS
* Prevent checkout_tree when conflicts exist, clear NAME on checkout treeEdward Thomson2013-10-161-0/+44
| | | | | | | Prevent checkout tree when unresolved changes exist (unless FORCE flag is specified). Clear NAME table when checking out, to avoid checkout_conflicts from attempting to manipulate it. Ensure that NAME is also cleared at reset.
* tests for checkout index with conflictsEdward Thomson2013-10-161-0/+460
|
* 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.
* More filtering tests including orderRussell Belfer2013-09-171-4/+32
| | | | | | | | | | | 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.
* Some tests with ident and crlf filtersRussell Belfer2013-09-171-0/+65
| | | | | | | | | | | | | | 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 helpers for testing file equalityRussell Belfer2013-09-172-69/+2
| | | | | | | | | 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.
* Start of filter API + git_blob_filtered_contentRussell Belfer2013-09-171-10/+1
| | | | | | | | | | 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
* No such thing as an orphan branchCarlos Martín Nieto2013-09-171-3/+3
| | | | | | | | | | | 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.
* 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.
* Update clarRussell Belfer2013-09-041-2/+2
|
* Add checkout test for long file nameBen Straub2013-08-071-0/+19
|
* test: Fix memory leaknulltoken2013-06-291-0/+2
|
* Fix checkout tests on WindowsRussell Belfer2013-06-242-6/+14
|
* Addition checkout target directory testsRussell Belfer2013-06-212-0/+115
| | | | | 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
* Fix checkout of modified file when missing from wdRussell Belfer2013-06-213-0/+123
| | | | | | | | | | 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.
* test asserting checkout should not recreate deleted filesEdward Thomson2013-06-201-0/+30
|
* 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 trailing whitespacesnulltoken2013-05-151-1/+1
|
* allow checkout to proceed when a dir to be removed is in use (win32)Edward Thomson2013-05-031-0/+63
|
* allow empty dirs to exist when doing checkoutEdward Thomson2013-05-011-0/+25
|
* use a longer string for dummy data in test to avoid conflicting w/ indexEdward Thomson2013-04-171-1/+1
|
* Redeploy git_revparse_single.Ben Straub2013-04-152-46/+15
|
* Deprecate git_revparse_single and _rangelikeBen Straub2013-04-092-15/+43
|
* Fix up checkout file contents checksRussell Belfer2013-03-255-59/+80
| | | | | | | | | | | | 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).
* don't convert CRLF to CRCRLFEdward Thomson2013-03-251-1/+45
|
* Test fixes and cleanupRussell Belfer2013-03-252-19/+8
| | | | | | | | 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-253-0/+59
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Add cl_repo_set_bool and cleanup testsRussell Belfer2013-03-224-69/+21
| | | | | | 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.
* don't dereference at the end of the workdir iteratorEdward Thomson2013-02-271-0/+38
|
* tests: Remove useless codenulltoken2013-02-051-5/+0
|
* Fix 3 memory leaksPhilip Kelley2013-01-251-0/+1
|
* tests-clar: ifdef GIT_WIN32 win helper functionsMichael Schubert2013-01-251-0/+2
|
* Merge pull request #1239 from ethomson/index_removeVicent Martí2013-01-173-4/+4
|\ | | | | add an index_remove_bypath that removes conflicts
| * add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson2013-01-123-4/+4
| | | | | | | | to match
* | add a git config, don't run crlf tests on non-win32Edward Thomson2013-01-171-0/+8
| |
* | cache should contain on-disk (filtered) file sizeEdward Thomson2013-01-171-0/+106
| |
* | Fix Travis compilation warningsnulltoken2013-01-131-3/+2
| |
* | checkout: Teach checkout to cope with orphaned Headnulltoken2013-01-131-0/+10
| | | | | | | | Fix #1236
* | tests: plug leaksCarlos Martín Nieto2013-01-121-0/+3
|/
* Merge pull request #1215 from phkelley/binaryunicodePhilip Kelley2013-01-111-0/+68
|\ | | | | Add a failing test for CRLF filters