summaryrefslogtreecommitdiff
path: root/tests/merge/workdir
Commit message (Collapse)AuthorAgeFilesLines
* path: separate git-specific path functions from utilEdward Thomson2021-11-092-90/+90
| | | | | | Introduce `git_fs_path`, which operates on generic filesystem paths. `git_path` will be kept for only git-specific path functionality (for example, checking for `.git` in a path).
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-177-75/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* tests: don't generate false positives on empty path segmentsPeter Pettersson2021-08-081-2/+2
|
* fileops: rename to "futils.h" to match function signaturesPatrick Steinhardt2019-07-204-4/+4
| | | | | | | | | Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
* tests: merge::analysis: use variants to deduplicate test suitesPatrick Steinhardt2019-06-131-80/+0
| | | | | | | | Since commit 394951ad4 (tests: allow for simple data-driven tests, 2019-06-07), we have the ability to run a given test suite with multiple variants. Use this new feature to deduplicate the test suites for merge::{trees,workdir}::analysis into a single test suite.
* Review fixes:Robert Coup2019-06-101-13/+18
| | | | | | - whitespace -> tabs - comment style - improve repo naming in merge/trees/analysis tests.
* Refactor testing:Robert Coup2019-06-101-112/+14
| | | | | - move duplication between merge/trees/ and merge/workdir/ into merge/analysis{.c,.h} - remove merge-resolve.git resource, open the existing merge-resolve as a bare repo instead.
* merge: add doc header to analysis testsRobert Coup2019-06-101-0/+3
|
* object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-011-6/+6
| | | | Use the new object_type enumeration names within the codebase.
* Merge pull request #4770 from tiennou/feature/merge-analysis-any-branchPatrick Steinhardt2018-11-301-20/+49
|\ | | | | Allow merge analysis against any reference
| * merge: make analysis possible against a non-HEAD referenceEtienne Samson2018-10-191-20/+49
| | | | | | | | | | | | | | This moves the current merge analysis code into a more generic version that can work against any reference. Also change the tests to check returned analysis values exactly.
* | Merge branch 'issue-4203'Edward Thomson2018-10-201-0/+29
|\ \ | |/ |/|
| * tests: add test case for index reloads on mergeEtiene Dalcol2017-11-111-0/+29
| | | | | | | | | | Adds a test case for the issue #4203, when diverging indexes on memory and disk cause git merge to abort with GIT_ECONFLICT
* | Merge pull request #4702 from tiennou/fix/coverityPatrick Steinhardt2018-07-201-1/+1
|\ \ | | | | | | Assorted Coverity fixes
| * | tests: add missing cl_git_pass to testsEtienne Samson2018-07-061-1/+1
| | | | | | | | | Reported by Coverity, CID 1393678-1393697.
* | | treewide: remove use of C++ style commentsPatrick Steinhardt2018-07-136-6/+6
|/ / | | | | | | | | | | | | | | | | 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.
* | Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-106-25/+25
| |
* | merge: reverse merge bases for recursive mergeEdward Thomson2018-02-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the commits being merged have multiple merge bases, reverse the order when creating the virtual merge base. This is for compatibility with git's merge-recursive algorithm, and ensures that we build identical trees. Git does this to try to use older merge bases first. Per 8918b0c: > It seems to be the only sane way to do it: when a two-head merge is > done, and the merge-base and one of the two branches agree, the > merge assumes that the other branch has something new. > > If we start creating virtual commits from newer merge-bases, and go > back to older merge-bases, and then merge with newer commits again, > chances are that a patch is lost, _because_ the merge-base and the > head agree on it. Unlikely, yes, but it happened to me.
* | merge: recursive uses larger conflict markersEdward Thomson2018-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | Git uses longer conflict markers in the recursive merge base - two more than the default (thus, 9 character long conflict markers). This allows users to tell the difference between the recursive merge conflicts and conflicts between the ours and theirs branches. This was introduced in git d694a17986a28bbc19e2a6c32404ca24572e400f. Update our tests to expect this as well.
* | Do not attempt to check out submodule as blob when merging a submodule ↵David Turner2017-12-041-0/+36
|/ | | | modify/deltete conflict
* Fix rebase bug and include test for merge=unionStan Hu2016-03-171-0/+36
|
* merge::workdir::dirty: update to use `st_ctime_nsec`Edward Thomson2016-03-071-2/+2
| | | | | Update unit test to use newfangled `st_ctime_nsec`, which provides indirection to the platform-correct name.
* 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.
* merge tests: correct castsEdward Thomson2016-02-111-3/+3
|
* merge: handle conflicts in recursive base buildingEdward Thomson2015-11-251-1/+34
| | | | | | | | | | | | | | | | | When building a recursive merge base, allow conflicts to occur. Use the file (with conflict markers) as the common ancestor. The user has already seen and dealt with this conflict by virtue of having a criss-cross merge. If they resolved this conflict identically in both branches, then there will be no conflict in the result. This is the best case scenario. If they did not resolve the conflict identically in the two branches, then we will generate a new conflict. If the user is simply using standard conflict output then the results will be fairly sensible. But if the user is using a mergetool or using diff3 output, then the common ancestor will be a conflict file (itself with diff3 output, haha!). This is quite terrible, but it matches git's behavior.
* recursive: test conflict output during recursive mergeEdward Thomson2015-11-251-0/+51
|
* merge tests: move expected data into own fileEdward Thomson2015-11-251-0/+1
|
* merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`Edward Thomson2015-11-251-3/+3
|
* cmake: Only provide USE_NSEC if struct stat members are avilable.Axel Rasmussen2015-09-181-2/+1
| | | | | | This allows us to remove OS checks from source code, instead relying on CMake to detect whether or not `struct stat` has the nanoseconds members we rely on.
* cmake: add USE_NSEC, and only check nanosec m/ctime if enabledAxel Rasmussen2015-09-181-1/+7
|
* merge: work around write-side racy protection when hacking the indexCarlos Martín Nieto2015-06-221-1/+14
| | | | | | | | | | As we attempt to replicate a situation in which an older checkout has put a file on disk with different filtering settings from us, set the timestamp on the entry and file to a second before we're performing the operation so the entry in the index counts as old. This way we can test that we're not looking at the on-disk file when the index has the entry and we detect it as clean.
* merge::workdir::dirty: tick idx to defeat racy-gitEdward Thomson2015-06-161-0/+12
|
* introduce `git_index_entry_is_conflict`Edward Thomson2015-05-281-1/+1
| | | | | | | | | It's not always obvious the mapping between stage level and conflict-ness. More importantly, this can lead otherwise sane people to write constructs like `if (!git_index_entry_stage(entry))`, which (while technically correct) is unreadable. Provide a nice method to help avoid such messy thinking.
* Renamed git_merge_options 'flags' to 'tree_flags'Jacques Germishuys2015-03-161-3/+3
|
* reset: remove reflog message overrideCarlos Martín Nieto2015-03-033-8/+8
| | | | | 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-034-10/+10
| | | | | | | | | | 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.
* merge: lock the index at the start of the mergeEdward Thomson2015-02-141-0/+49
| | | | | | | | | | Always lock the index when we begin the merge, before we write any of the metdata files. This prevents a race where another client may run a commit after we have written the MERGE_HEAD but before we have updated the index, which will produce a merge commit that is treesame to one parent. The merge will finish and update the index and the resultant commit would not be a merge at all.
* merge test: test an actual failure, not conflictEdward Thomson2015-02-131-6/+5
| | | | | | Correct the merge failed cleanup test. Merge data should not be cleaned up on conflicts, only on actual failure. And ORIG_HEAD should not be removed at all.
* Fix broken merge tests due to autocrlf was not falseLinquize2014-12-071-0/+8
|
* s/git_merge_head/git_annotated_commitEdward Thomson2014-10-266-276/+277
| | | | | Rename git_merge_head to git_annotated_commit, as it becomes used in more operations than just merge.
* Allow to propagate checkout callbacks to git HARD resetSven Strickroth2014-08-033-8/+8
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* git_checkout_index: checkout other indexesEdward Thomson2014-07-011-1/+1
| | | | | | | | git_checkout_index can now check out other git_index's (that are not necessarily the repository index). This allows checkout_index to use the repository's index for stat cache information instead of the index data being checked out. git_merge and friends now check out their indexes directly instead of trying to blend it into the running index.
* Modify GIT_MERGE_CONFIG -> GIT_MERGE_PREFERENCEEdward Thomson2014-05-271-18/+18
|
* Move GIT_MERGE_CONFIG_* to its own enumEdward Thomson2014-05-271-31/+38
|
* Introduce GIT_MERGE_CONFIG_* for merge.ff settingsEdward Thomson2014-05-271-0/+26
| | | | | | git_merge_analysis will now return GIT_MERGE_CONFIG_NO_FASTFORWARD when merge.ff=false and GIT_MERGE_CONFIG_FASTFORWARD_ONLY when merge.ff=true
* merge: checkout default shouldn't clobber givenEdward Thomson2014-04-232-10/+11
|
* merge: default checkout strategy for should be SAFEEdward Thomson2014-04-231-0/+17
|
* Capture conflict information in MERGE_MSG for revert and mergeJacques Germishuys2014-04-141-1/+9
|
* Introduce git_merge_head_idEdward Thomson2014-03-311-0/+27
|
* UNBORN implies FAST_FORWARDEdward Thomson2014-03-201-1/+2
|