summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* commit: also match the first header field when searchingcmn/header-field-2Carlos Martín Nieto2016-02-091-0/+4
| | | | | | | | We were searching only past the first header field, which meant we were unable to find e.g. `tree` which is the first field. While here, make sure to set an error message in case we cannot find the field.
* git_repository_init: include dotfiles when copying templatesEdward Thomson2015-12-261-1/+12
| | | | | | Include dotfiles when copying template directory, which will handle both a template directory itself that begins with a dotfile, and any dotfiles inside the directory.
* repo::init tests: test a template dir with leading dotEdward Thomson2015-12-261-9/+37
| | | | | Ensure that we can handle template directories that begin with a leading dot.
* repo::init tests: test init.templatedir settingEdward Thomson2015-12-261-38/+93
| | | | | Ensure that `git_repository_init` honors the `init.templatedir` configuration setting.
* typos in commentsDmitriy Olshevskiy2015-12-212-2/+2
|
* commit: Fix memory leak in test suitevmg/commit-leakVicent Marti2015-12-171-1/+1
|
* Merge pull request #3521 from pks-t/blame-line-overflowEdward Thomson2015-12-1410-7/+17
|\ | | | | Line count overflow in git_blame_hunk and git_blame__entry
| * blame: use size_t for line counts in git_blame_hunkPatrick Steinhardt2015-12-0110-7/+17
| | | | | | | | | | | | | | | | | | | | It is not unreasonable to have versioned files with a line count exceeding 2^16. Upon blaming such files we fail to correctly keep track of the lines as `git_blame_hunk` stores them in `uint16_t` fields. Fix this by converting the line fields of `git_blame_hunk` to `size_t`. Add test to verify behavior.
* | Merge pull request #3522 from pks-t/email-format-commit-messageCarlos Martín Nieto2015-12-108-1/+83
|\ \ | | | | | | diff: include commit message when formatting patch
| * | diff: include commit message when formatting patchPatrick Steinhardt2015-12-017-1/+44
| | | | | | | | | | | | | | | | | | When formatting a patch as email we do not include the commit's message in the formatted patch output. Implement this and add a test that verifies behavior.
| * | commit: introduce `git_commit_body`Patrick Steinhardt2015-12-011-0/+39
| |/ | | | | | | | | | | | | | | | | It is already possible to get a commit's summary with the `git_commit_summary` function. It is not possible to get the remaining part of the commit message, that is the commit message's body. Fix this by introducing a new function `git_commit_body`.
* | reset: perform the checkout before moving HEAD or the indexcmn/reset-dir-fileCarlos Martín Nieto2015-12-091-0/+52
| | | | | | | | | | | | This keeps the state of the workdir the same as one from HEAD, removing a source of possible confusion when calculating the work that is to be done.
* | 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>
* tests: fix warning for nested struct initializationPatrick Steinhardt2015-11-301-1/+1
|
* Merge pull request #3513 from ethomson/merge_recursiveCarlos Martín Nieto2015-11-30169-54/+796
|\ | | | | Recursive Merge
| * recursive merge: add a recursion limitEdward Thomson2015-11-251-0/+31
| |
| * merge: handle conflicts in recursive base buildingEdward Thomson2015-11-2527-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * merge tests: add complex recursive exampleEdward Thomson2015-11-2512-6/+39
| |
| * recursive: test conflict output during recursive mergeEdward Thomson2015-11-252-0/+81
| |
| * merge tests: move expected data into own fileEdward Thomson2015-11-256-44/+47
| |
| * merge: add recursive test with conflicting contentsEdward Thomson2015-11-259-0/+32
| |
| * merge: add recursive test with three merge basesEdward Thomson2015-11-2528-0/+65
| |
| * merge: improve test names in recursive merge testsEdward Thomson2015-11-251-8/+8
| |
| * merge: add a third-level recursive mergeEdward Thomson2015-11-2513-0/+58
| |
| * merge: add a second-level recursive mergeEdward Thomson2015-11-2512-2/+57
| |
| * merge: add simple recursive testEdward Thomson2015-11-2570-1/+233
| | | | | | | | | | Add a simple recursive test - where multiple ancestors exist and creating a virtual merge base from them would prevent a conflict.
| * merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`Edward Thomson2015-11-255-9/+9
| |
* | tests: win32::longpath: free expected_msgPatrick Steinhardt2015-11-241-0/+2
| |
* | tests: config::stress: free `git_config` structsPatrick Steinhardt2015-11-241-0/+3
| |
* | tests: config::global: fix memleak in open_programdataPatrick Steinhardt2015-11-241-1/+1
|/
* Merge pull request #3517 from jacquesg/warnings-fixesEdward Thomson2015-11-204-3/+3
|\ | | | | Fix some warnings
| * Fix some warningsJacques Germishuys2015-11-204-3/+3
| |
* | repository: distinguish sequencer cherry-pick and revertcmn/repository-state-sequencerCarlos Martín Nieto2015-11-201-0/+18
|/ | | | These are not quite like their plain counterparts and require special handling.
* Merge pull request #3511 from ethomson/racy_fixes_2Carlos Martín Nieto2015-11-172-10/+192
|\ | | | | Racy fixes for writing new indexes
| * racy: make git_index_read_index handle racinessEdward Thomson2015-11-161-0/+48
| | | | | | | | | | | | | | | | | | | | | | Ensure that `git_index_read_index` clears the uptodate bit on files that it modifies. Further, do not propagate the cache from an on-disk index into another on-disk index. Although this should not be done, as `git_index_read_index` is used to bring an in-memory index into another index (that may or may not be on-disk), ensure that we do not accidentally bring in these bits when misused.
| * racy: ensure git_index_read_tree clears uptodateEdward Thomson2015-11-161-0/+28
| | | | | | | | | | Ensure that `git_index_read_tree` clears the uptodate bit on files that it modifies.
| * index: test for smudged entries on write onlyEdward Thomson2015-11-161-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that entries are only smudged when we write the index: the entry smudging is to prevent us from updating an index in a way that it would be impossible to tell that an item was racy. Consider when we load an index: any entries that have the same (or newer) timestamp than the index itself are considered racy, and are subject to further scrutiny. If we *save* that index with the same entries that we loaded, then the index would now have a newer timestamp than the entries, and they would no longer be given that additional scrutiny, failing our racy detection! So test that we smudge those entries only on writing the new index, but that we can detect them (in diff) without having to write.
| * 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.
| * index: don't detect raciness in uptodate entriesEdward Thomson2015-11-161-0/+77
| | | | | | | | | | | | | | | | | | | | | | Keep track of entries that we believe are up-to-date, because we added the index entries since the index was loaded. This prevents us from unnecessarily examining files that we wrote during the cleanup of racy entries (when we smudge racily clean files that have a timestamp newer than or equal to the index's timestamp when we read it). Without keeping track of this, we would examine every file that we just checked out for raciness, since all their timestamps would be newer than the index's timestamp.
* | tests: use out-of-the-way config dir in sandboxEdward Thomson2015-11-171-5/+12
| | | | | | | | | | | | Don't put the configuration in a subdir of the sandbox named `config`, lest some tests decide to create their own directory called `config`. Prefix with some underscores for uniqueness.
* | tests: set PROGRAMDATA directory for running testsEdward Thomson2015-11-171-0/+2
| |
* | config::global: use PROGRAMDATA configurationEdward Thomson2015-11-171-4/+6
|/ | | | | Query the `GIT_CONFIG_LEVEL_PROGRAMDATA` location when setting it up for tests, in case the test runner has sandboxed it.
* pool: Never return unaligned buffersvmg/pool-alignVicent Marti2015-11-131-2/+2
|
* Merge pull request #3170 from CmdrMoozy/nsec_fixCarlos Martín Nieto2015-11-124-14/+25
|\ | | | | git_index_entry__init_from_stat: set nsec fields in entry stats
| * Merge branch 'master' into nsec_fix_nextAxel Rasmussen2015-10-0135-24/+222
| |\
| * | diff/index: respect USE_NSEC for racily clean file detectionAxel Rasmussen2015-09-182-13/+13
| | |
| * | 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.
| * | caps: add test for GIT_FEATURES_NSECAxel Rasmussen2015-09-181-0/+6
| | |
| * | cmake: add USE_NSEC, and only check nanosec m/ctime if enabledAxel Rasmussen2015-09-181-1/+7
| | |
* | | Merge pull request #3499 from ethomson/ref_dir_errmsgsCarlos Martín Nieto2015-11-123-0/+97
|\ \ \ | | | | | | | | Improve error messages when dirs prevent ref/reflog creation