summaryrefslogtreecommitdiff
path: root/tests/checkout/tree.c
Commit message (Collapse)AuthorAgeFilesLines
* object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-011-22/+22
| | | | Use the new object_type enumeration names within the codebase.
* index: use new enum and structure namesEdward Thomson2018-12-011-3/+3
| | | | Use the new-style index names throughout our own codebase.
* Merge pull request #4702 from tiennou/fix/coverityPatrick Steinhardt2018-07-201-3/+3
|\ | | | | Assorted Coverity fixes
| * tests: add missing cl_git_pass to testsEtienne Samson2018-07-061-3/+3
| | | | | | Reported by Coverity, CID 1393678-1393697.
* | treewide: remove use of C++ style commentsPatrick Steinhardt2018-07-131-1/+1
|/ | | | | | | | | C++ style comment ("//") are not specified by the ISO C90 standard and thus do not conform to it. While libgit2 aims to conform to C90, we did not enforce it until now, which is why quite a lot of these non-conforming comments have snuck into our codebase. Do a tree-wide conversion of all C++ style comments to the supported C style comments to allow us enforcing strict C90 compliance in a later commit.
* checkout: FORCE doesn't halt on dirty indexEdward Thomson2018-06-291-11/+0
| | | | | If the index is dirty, allow `GIT_CHECKOUT_FORCE` to obliterate unsaved changes. This is in keeping with its name and description.
* index: commit the changes to the index properlyEdward Thomson2018-06-291-4/+23
| | | | | | | Now that the index has a "dirty" state, where it has changes that have not yet been committed or rolled back, our tests need to be adapted to actually commit or rollback the changes instead of assuming that the index can be operated on in its indeterminate state.
* checkout tests: validate GIT_CHECKOUT_NO_REFRESHEdward Thomson2018-06-291-0/+64
| | | | | | Add tests that ensure that we re-read the on-disk image by default during checkout, but when the `GIT_CHECKOUT_NO_REFRESH` option is specified, we do _not_ re-read the index.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-4/+4
|
* tests: status::worktree: indicate skipped tests on Win32Patrick Steinhardt2018-01-031-0/+2
| | | | | | | | | Some function bodies of tests which are not applicable to the Win32 platform are completely #ifdef'd out instead of calling `cl_skip()`. This leaves us with no indication that these tests are not being executed at all and may thus cause decreased scrutiny when investigating skipped tests. Improve the situation by calling `cl_skip()` instead of just doing nothing.
* tests: checkout::tree: check that the status list catches mode changesPatrick Steinhardt2017-10-091-0/+2
| | | | | | | | While we verify that we have no mode changes after calling `git_checkout_tree`, we do not verify that the `p_chmod` calls actually resulted in a changed entry. While we should assume that this works due to separate tests for the status list, we should test for the change being listed to avoid programming errors in the test.
* tests: checkout::tree: extract check for status entrycountPatrick Steinhardt2017-10-091-17/+14
| | | | | | There are multiple locations where we have the same code to check whether the count of status list entries of a repository matches an expected number. Extract that into a common function.
* checkout: test force checkout when mode changesethomson/checkout_typechangeEdward Thomson2017-10-071-0/+45
| | | | | Test that we can successfully force checkout a target when the file contents are identical, but the mode has changed.
* checkout::tree test: cleanup memory leakEdward Thomson2017-01-231-4/+1
|
* Fix handling of GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH flag.John Fultz2016-12-291-0/+38
| | | | | | | | | | | | | | | | | git_checkout_tree() sets up its working directory iterator to respect the pathlist if GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH is present, which is great. What's not so great is that this iterator is then used side-by-side with an iterator created by git_checkout_iterator(), which did not set up its pathlist appropriately (although the iterator mirrors all other iterator options). This could cause git_checkout_tree() to delete working tree files which were not specified in the pathlist when GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH was used, as the unsynchronized iterators causes git_checkout_tree() to think that files have been deleted between the two trees. Oops. And added a test which fails without this fix (specifically, the final check for "testrepo/README" to still be present fails).
* 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`.
* 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
|
* 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-281-3/+3
|
* checkout test: only run icase on icase platformEdward Thomson2015-05-041-79/+0
|
* 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.
* 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.
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-14/+14
| | | | | | 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.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-18/+18
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* checkout tests: just use SAFE where appropriateEdward Thomson2015-02-271-7/+3
|
* checkout: remove `GIT_CHECKOUT_SAFE_CREATE` as a strategyEdward Thomson2015-02-271-5/+11
|
* checkout: upgrade to `SAFE_CREATE` when no index fileEdward Thomson2015-02-271-0/+36
| | | | | | When the repository does not contain an index, emulate git's behavior and upgrade to `SAFE_CREATE`. This allows us to check out repositories created with `git clone --no-checkout`.
* checkout: introduce GIT_CHECKOUT_DONT_WRITE_INDEXEdward Thomson2015-02-141-0/+80
|
* remove some unused warningsEdward Thomson2015-02-041-0/+4
|
* checkout test: ensure .gitattributes lifecycleEdward Thomson2015-02-021-0/+50
| | | | | | The .gitattributes cache should not reload .gitattributes in the middle of checking out, only between checkout operations. Otherwise, we'll spend all our time stat'ing and read'ing the gitattributes.
* checkout: introduce git_checkout_perfdataEdward Thomson2015-01-201-0/+29
| | | | | Checkout can now provide performance data about the number of (some) syscalls performed using an optional callback.
* Plug a couple of leaksCarlos Martín Nieto2015-01-041-0/+1
|
* Always checkout with case sensitive iteratorEdward Thomson2014-12-231-13/+2
| | | | | | | | | On a case-insensitive filesystem, we need to deal with case-changing renames (eg, foo -> FOO) by removing the old and adding the new, exactly as if we were on a case-sensitive filesystem. Update the `checkout::tree::can_cancel_checkout_from_notify` test, now that notifications are always sent case sensitively.
* Introduce test for checkout case-changing renameEdward Thomson2014-12-231-0/+77
|
* Plug leaksCarlos Martín Nieto2014-11-231-0/+2
| | | | Valgrind is now clean except for libssl and libgcrypt.
* checkout_index: remove conflicts when checking out new filesEdward Thomson2014-11-061-3/+87
|
* Allow to propagate checkout callbacks to git HARD resetSven Strickroth2014-08-031-1/+1
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-18/+18
|
* Add reflog parameters to git_resetBen Straub2014-02-031-1/+1
|
* Add reflog params to git_branch_createBen Straub2014-01-301-1/+1
|
* Add reflog params to set-head callsBen Straub2014-01-301-11/+11
|