summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* commit: split creating the commit and writing it outcmn/commit-to-memoryCarlos Martín Nieto2016-03-081-0/+39
| | | | | | Sometimes you want to create a commit but not write it out to the objectdb immediately. For these cases, provide a new function to retrieve the buffer instead of having to go through the db.
* treebuilder: don't try to verify submodules exist in the odbcmn/treebuilder-submoduleCarlos Martín Nieto2016-03-041-0/+12
| | | | | | | | Submodules don't exist in the objectdb and the code is making us try to look for a blob with its commit id, which is obviously not going to work. Skip the test if the user wants to insert a submodule.
* tests: take the version from our defineCarlos Martín Nieto2016-03-031-1/+1
|
* tests: plug a leakCarlos Martín Nieto2016-03-031-0/+1
|
* turn on strict object validation by defaultEdward Thomson2016-02-283-28/+28
|
* tests: use legitimate object idsEdward Thomson2016-02-2812-44/+57
| | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
* refs: honor strict object creationEdward Thomson2016-02-281-2/+24
|
* git_index_add: validate objects in index entries (optionally)Edward Thomson2016-02-281-0/+84
| | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the index entries given to `git_index_add`.
* treebuilder: validate tree entries (optionally)Edward Thomson2016-02-281-0/+55
| | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to treebuilder insertion.
* git_commit: validate tree and parent idsEdward Thomson2016-02-281-5/+106
| | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to commit creation functions.
* Merge pull request #3577 from rossdylan/rossdylan/pooldebugEdward Thomson2016-02-281-0/+6
|\ | | | | Add a new build flag to disable the pool allocator
| * Add a new build flag to disable the pool allocator and pass all ↵Ross Delinger2016-01-121-0/+6
| | | | | | | | git_pool_malloc calls straight to git__malloc
* | nsec: update staging test for GIT_USE_NSECSEdward Thomson2016-02-251-0/+9
| | | | | | | | | | | | | | | | The index::nsec::staging_maintains_other_nanos test was created to ensure that when we stage an entry when GIT_USE_NSECS is *unset* that we truncate the index entry and do not persist the (old, invalid) nanosec values. Ensure that when GIT_USE_NSECS is *set* that we do not do that, and actually write the correct nanosecond values.
* | git_libgit2_opts: validate keyEdward Thomson2016-02-221-0/+6
| |
* | Merge pull request #3613 from ethomson/fixupsCarlos Martín Nieto2016-02-187-11/+11
|\ \ | | | | | | Remove most of the silly warnings
| * | win32: drop incorrect `const`nessEdward Thomson2016-02-161-1/+1
| | |
| * | win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-125-6/+6
| | | | | | | | | | | | | | | 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
| | |
| * | reset test: fix initialization warningEdward Thomson2016-02-111-1/+1
| | |
* | | Merge pull request #3619 from ethomson/win32_forbiddenCarlos Martín Nieto2016-02-1814-6/+212
|\ \ \ | | | | | | | | win32: allow us to read indexes with forbidden paths on win32
| * | | index: allow read of index w/ illegal entriesEdward Thomson2016-02-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow `git_index_read` to handle reading existing indexes with illegal entries. Allow the low-level `git_index_add` to add properly formed `git_index_entry`s even if they contain paths that would be illegal for the current filesystem (eg, `AUX`). Continue to disallow `git_index_add_bypath` from adding entries that are illegal universally illegal (eg, `.git`, `foo/../bar`).
| * | | win32: tests around handling forbidden pathsEdward Thomson2016-02-1713-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a repository that contains some paths that were illegal on PC-DOS circa 1981 (like `aux`, `con`, `com1`) and that in a bizarre fit of retrocomputing, remain illegal on some "modern" computers, despite being "new technology". Introduce some aspirational tests that suggest that we should be able to cope with trees and indexes that contain paths that would be illegal on the filesystem, so that we can at least diff them. Further ensure that checkout will not write a repository with forbidden paths.
* | | | commit: expose the different kinds of errorsCarlos Martín Nieto2016-02-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | We should be checking whether the object we're looking up is a commit, and we should let the caller know whether the not-found return code comes from a bad object type or just a missing signature.
* | | | rebase: persist a single in-memory indexEdward Thomson2016-02-152-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | When performing an in-memory rebase, keep a single index for the duration, so that callers have the expected index lifecycle and do not hold on to an index that is free'd out from under them.
* | | | Merge pull request #3610 from ethomson/rebase_bareCarlos Martín Nieto2016-02-123-6/+168
|\ \ \ \ | | | | | | | | | | rebase: introduce bare rebasing
| * | | | rebase: allow custom merge_optionsEdward Thomson2016-02-111-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow callers of rebase to specify custom merge options. This may allow custom conflict resolution, or failing fast when conflicts are detected.
| * | | | rebase: introduce inmemory rebasingEdward Thomson2016-02-112-6/+138
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the ability to rebase in-memory or in a bare repository. When `rebase_options.inmemory` is specified, the resultant `git_rebase` session will not be persisted to disk. Callers may still analyze the rebase operations, resolve any conflicts against the in-memory index and create the commits. Neither `HEAD` nor the working directory will be updated during this process.
* | | | Horrible fix for #3173.Arthur Schreiber2016-02-112-27/+27
| | | |
* | | | commit: don't forget the last header fieldCarlos Martín Nieto2016-02-111-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | When we moved the logic to handle the first one, wrong loop logic was kept in place which meant we still finished early. But we now notice it because we're not reading past the last LF we find. This was not noticed before as the last field in the tested commit was multi-line which does not trigger the early break.
* | | Merge pull request #3599 from libgit2/gpgsignVicent Marti2016-02-091-0/+49
|\ \ \ | | | | | | | | Introduce git_commit_extract_signature
| * | | Introduce git_commit_extract_signaturegpgsignCarlos Martín Nieto2016-02-091-0/+49
| | |/ | |/| | | | | | | | | | | | | This returns the GPG signature for a commit and its contents without the signature block, allowing for the verification of the commit's signature.
* | | 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
| |