summaryrefslogtreecommitdiff
path: root/tests/checkout/head.c
Commit message (Collapse)AuthorAgeFilesLines
* checkout test: ensure workdir mode is simplifiedEdward Thomson2018-02-231-0/+27
| | | | | | | | | | | | Ensure that when examining the working directory for checkout that the mode is correctly simplified. Git only pays attention to whether a file is executable or not. When examining a working directory, we should coalesce modes in the working directory to either `0755` (indicating that a file is executable) or `0644` (indicating that it is not). Test this by giving the file an exotic mode, and ensuring that when checkout out a branch that changes the file's contents, that we do not have a checkout conflict.
* checkout test: add core.filemode checkout testsEdward Thomson2018-02-231-0/+56
| | | | | | | | | | | | | | | | | | | | | | Add two tests for filemode. The first ensures that `core.filemode=true` is honored: if we have changed the filemode such that a file that _was_ executable (mode 0755) is now executable (mode 0644) and we go to check out a branch that has otherwise changed the contents of the file, then we should raise a checkout conflict for that file. The second ensures that `core.filemode=false` is honored: in the same situation, we set a file that was executable to be non-executable, and check out the branch that changes the contents of the file. However, since `core.filemode` is false, we do not detect the filemode change. We run these tests on both operating systems that obey `core.filemode` (eg, POSIX) and those that have no conception of filemode (eg, Win32). This ensures that `core.filemode` is always honored, as it is a cache of the underlying filesystem's settings. This ensures that we do not make assumptions based on the operating system, and honor the configuration setting even if it were misconfigured.
* checkout test: further ensure workdir perms are updatedethomson/checkout_typechange_with_index_and_wdEdward Thomson2018-02-201-0/+25
| | | | | | | When both the index _and_ the working directory has changed permissions on a file permissions on a file - but only the permissions, such that the contents of the file are identical - ensure that `git_checkout` updates the permissions to match the checkout target.
* checkout test: ensure workdir perms are updatedEdward Thomson2018-02-201-0/+20
| | | | | | | When the working directory has changed permissions on a file - but only the permissions, such that the contents of the file are identical - ensure that `git_checkout` updates the permissions to match the checkout target.
* checkout: do not delete directories with untracked entriesPatrick Steinhardt2017-06-101-0/+76
| | | | | | | | | | If the `GIT_CHECKOUT_FORCE` flag is given to any of the `git_checkout` invocations, we remove files which were previously staged. But while doing so, we unfortunately also remove unstaged files in a directory which contains at least one staged file, resulting in potential data loss. This commit adds two tests to verify behavior.
* tests: fix indentation in checkout::head::with_index_only_treePatrick Steinhardt2017-04-101-1/+1
|
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-1/+1
|
* Rename tests-clar to testsBen Straub2013-11-141-0/+62