summaryrefslogtreecommitdiff
path: root/tests/checkout
Commit message (Collapse)AuthorAgeFilesLines
* git_checkout_tree options fixStefan Huber2016-08-301-0/+4
| | | | | | | | According to the reference the git_checkout_tree and git_checkout_head functions should accept NULL in the opts field This was broken since the opts field was dereferenced and thus lead to a crash.
* checkout: use empty baseline when no indexethomson/checkout_no_indexEdward Thomson2016-06-151-0/+63
| | | | | When no index file exists and a baseline is not explicitly provided, use an empty baseline instead of trying to load `HEAD`.
* tests: fix memory leaks in checkout::typechangePatrick Steinhardt2016-06-071-2/+2
|
* cleanup: unused warningEdward Thomson2016-06-011-0/+3
|
* Merge pull request #3798 from mmuman/stat-test-fixEdward Thomson2016-05-261-2/+3
|\ | | | | test: Fix stat() test to mask out unwanted bits
| * test: Fix stat() test to mask out unwanted bitsFrançois Revol2016-05-241-2/+3
| | | | | | | | Haiku and Hurd both pass extra bits in struct stat::st_mode.
* | checkout: handle dirty submodules correctlyJason Haslam2016-05-261-8/+74
|/ | | | | Don't generate conflicts when checking out a modified submodule and the submodule is dirty or modified in the workdir.
* win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-121-1/+1
| | | | | Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
* checkout test: Apply umask to file-mode test as wellMichał Górny2015-12-011-1/+1
| | | | | | | | Fix the file-mode test to expect system umask being applied to the created file as well (it is currently applied to the directory only). This fixes the test on systems where umask != 022. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Fix some warningsJacques Germishuys2015-11-201-1/+1
|
* checkout::crlf test: don't crash when no idx entryEdward Thomson2015-11-161-4/+5
| | | | | | | | | | When there's no matching index entry (for whatever reason), don't try to dereference the null return value to get at the id. Otherwise when we break something in the index API, the checkout test crashes for confusing reasons and causes us to step through it in a debugger thinking that we had broken much more than we actually did.
* diff/index: respect USE_NSEC for racily clean file detectionAxel Rasmussen2015-09-181-5/+5
|
* git_futils_mkdir_*: make a relative-to-base mkdirEdward Thomson2015-09-171-1/+1
| | | | | | | | | | | | Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter assumes that we own everything beneath the base, as if it were being called with a base of the repository or working directory, and is tailored towards checkout and ensuring that there is no bogosity beneath the base that must be cleaned up. This is (at best) slow and (at worst) unsafe in the larger context of a filesystem where we do not own things and cannot do things like unlink symlinks that are in our way.
* checkout: overwrite files with differing modesEdward Thomson2015-09-161-1/+2
| | | | | | | | | | | When a file exists on disk and we're checking out a file that differs in executableness, remove the old file. This allows us to recreate the new file with p_open, which will take the new mode into account and handle setting the umask properly. Remove any notion of chmod'ing existing files, since it is now handled by the aforementioned removal and was incorrect, as it did not take umask into account.
* checkout::tree tests: don't use hardcoded modeEdward Thomson2015-09-161-8/+8
|
* checkout::tree tests: don't use static bufferEdward Thomson2015-09-161-6/+9
|
* Check that checkout preserves filemode in working directory.Matti Virolainen2015-09-161-0/+63
|
* Check that an executable in index is not an executable after checkout.Matti Virolainen2015-09-161-0/+11
|
* checkout test: mark unused varsEdward Thomson2015-06-301-1/+4
|
* checkout test: check getcwd return valueEdward Thomson2015-06-291-1/+1
|
* checkout: plug a few leaksCarlos Martín Nieto2015-06-261-5/+15
|
* crlf tests: ensure that Unix obeys autocrlf=trueEdward Thomson2015-06-221-56/+17
| | | | | All platforms do terrible, horrible, no good, very bad translation when core.autocrlf=true. It's not just Windows!
* crlf tests: use known-good data produced by gitEdward Thomson2015-06-221-36/+156
| | | | | | Given a variety of combinations of core.autocrlf settings and attributes settings, test that we check out data into the working directory the same as a known-good test resource created by git.git.
* crlf: include utf8 resources in master branchEdward Thomson2015-06-221-7/+7
| | | | | Include the UTF8 and UTF8 BOM tests in the master crlf test branch for completeness.
* tests: tick over five seconds instead of oneCarlos Martín Nieto2015-06-201-1/+1
| | | | | | | | | | | | | When ticking over one second, it can happen that the actual time ticks over the same second between the time that we undermine our own race protections and the time in which we perform the index update. Such timing would make the time in the entries match the index' timestamp and we have not gained anything. Ticking over five seconds makes it so that if real-time rolls over that second, our index is still ahead. This is still suboptimal as we're dealing with timing, but five seconds should be long enough for any reasonable test runner to finish the tests.
* Fixed Xcode 6.1 build warningsPierre-Olivier Latour2015-06-171-1/+0
|
* Introduce p_utimes and p_futimesEdward Thomson2015-06-161-5/+7
| | | | | | Provide functionality to set the time on a filesystem entry, using utimes or futimes on POSIX type systems or SetFileTime on Win32.
* tests: tick the index when we count OID calculationsCarlos Martín Nieto2015-06-163-19/+22
| | | | | | | | | These tests want to test that we don't recalculate entries which match the index already. This is however something we force when truncating racily-clean entries. Tick the index forward as we know that we don't perform the modifications which the racily-clean code is trying to avoid.
* crlf: tick the index forward to work around racy-git behaviourCarlos Martín Nieto2015-06-161-4/+26
| | | | | | | | | | | | In order to avoid racy-git, we zero out the file size for entries with the same timestamp as the index (or during the initial checkout). This is the case in a couple of crlf tests, as the code is fast enough to do everything in the same second. As we know that we do not perform the modification just after writing out the index, which is what this is designed to work around, tick the mtime of the index file such that it doesn't agree with the files anymore, and we do not zero out these entries.
* Fix leaks in tests/checkout/icaseJeff Hostetler2015-06-121-0/+2
|
* Rename GIT_EMERGECONFLICT to GIT_ECONFLICTEdward Thomson2015-05-291-7/+7
| | | | | | | | | | We do not error on "merge conflicts"; on the contrary, merge conflicts are a normal part of merging. We only error on "checkout conflicts", where a change exists in the index or the working directory that would otherwise be overwritten by performing the checkout. This *may* happen during merge (after the production of the new index that we're going to checkout) but it could happen during any checkout.
* conflict tests: use GIT_IDXENTRY_STAGE_SETEdward Thomson2015-05-283-7/+7
|
* Fix ident replacement to match Git behaviorColomban Wendling2015-05-261-6/+6
| | | | | Git inserts a space after the SHA1 (as of 2.1.4 at least), so do the same.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-3/+1
| | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* checkout test: better case-insensitive test on MacEdward Thomson2015-05-041-3/+29
| | | | | | | | On Mac OS, `realpath` is deficient in determining the actual filename on-disk as it will simply provide the string you gave it if that file exists, instead of returning the filename as it exists. Instead we must read the directory entries for the parent directory to get the canonical filename.
* checkout test: only run icase on icase platformEdward Thomson2015-05-042-79/+61
|
* checkout: remove blocking dir when FORCEdEdward Thomson2015-05-041-7/+91
|
* Revert "Always checkout with case sensitive iterator"Edward Thomson2015-05-041-2/+13
| | | | This reverts commit 40d791545abfb3cb71553a27dc64129e1a9bec28.
* checkout test: ensure we write to casechanged dirEdward Thomson2015-05-041-0/+57
| | | | | | Ensure that on a case insensitive filesystem that we can checkout into some folder 'FOLDER' that exists on disk, even if the target of the checkout is a different case (eg 'folder').
* checkout test: ignore unstaged case-changing renamesEdward Thomson2015-05-041-0/+22
| | | | | | | | On Windows, you might sloppily rewrite a file (or have a sloppy text editor that does it for you) and accidentally change its case. (eg, "README" -> "readme"). Git ignores this accidental case changing rename during checkout and will happily write the new content to the file despite the name change. We should, too.
* Merge pull request #3032 from jfultz/index-file-modesEdward Thomson2015-04-231-2/+27
|\ | | | | Fix git_checkout_tree() to do index filemodes correctly on Windows.
| * Fix git_checkout_tree() to do index filemodes correctly on Windows.John Fultz2015-04-061-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | git_checkout_tree() has some fallback behaviors for file systems which don't have full support of filemodes. Generally works fine, but if a given file had a change of type from a 0644 to 0755 (i.e., you add executable permissions), the fallback behavior incorrectly triggers when writing hte updated index. This would cause a git_checkout_tree() command, even with the GIT_CHECKOUT_FORCE option set, to leave a dirty index on Windows. Also added checks to an existing test to catch this case.
* | Merge pull request #3030 from linquize/symlink_supportedEdward Thomson2015-04-101-0/+47
|\ \ | |/ |/| If work_dir is not specified, use repo_dir to test if symlink is supported
| * Test: Create repo in while current dir is readonly and checkout symlinkLinquize2015-04-041-0/+47
| |
* | Illustrate bad checkout on WindowsJacques Germishuys2015-03-251-0/+20
|/
* Lower case the include directive of windows headerClaudiu Olteanu2015-03-161-1/+1
| | | Since the Linux platform has a case sensitive file system, the header name should be lower case for cross compiling purposes. (On Linux, the mingw header is called ```windows.h```).
* Remove swp filesCarlos Martín Nieto2015-03-031-0/+0
|
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-033-17/+17
| | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* branch: don't accept a reflog message overrideCarlos Martín Nieto2015-03-031-3/+3
| | | | | | | This namespace is about behaving like git's branch command, so let's do exactly that instead of taking a reflog message. This override is still available via the reference namespace.
* reset: remove reflog message overrideCarlos Martín Nieto2015-03-031-1/+1
| | | | | This function is meant to simulate what git does in the reset command, so we should include the reflog message in that.