summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix checkout notify callback docs and testsRussell Belfer2013-12-111-0/+78
| | | | | | | | | | | | | | The checkout notify callback behavior on non-zero return values was not being tested. This adds tests, fixes a bug with positive values, and clarifies the documentation to make it clear that the checkout can be canceled via this mechanism.
* | Update git_blob_create_fromchunks callback behavrRussell Belfer2013-12-111-1/+38
| | | | | | | | | | | | | | The callback to supply data chunks could return a negative value to stop creation of the blob, but we were neither using GIT_EUSER nor propagating the return value. This makes things use the new behavior of returning the negative value back to the user.
* | Remove converting user error to GIT_EUSERRussell Belfer2013-12-1114-41/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* | Further EUSER and error propagation fixesRussell Belfer2013-12-111-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* | Improve GIT_EUSER handlingRussell Belfer2013-12-114-21/+126
| | | | | | | | | | | | | | | | | | | | | | This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
* | Merge pull request #1985 from libgit2/diff-rename-configRussell Belfer2013-12-111-0/+183
|\ \ | | | | | | Rename detection using diff.renames
| * | Don't clobber whitespace settingsBen Straub2013-12-061-0/+42
| | |
| * | Don't use weird return codesBen Straub2013-12-051-0/+3
| | |
| * | Implement GIT_DIFF_FIND_BY_CONFIGBen Straub2013-12-051-0/+138
| | |
* | | Clean up warningsEdward Thomson2013-12-094-24/+10
|/ /
* | Reorder var decls in revert testEdward Thomson2013-12-031-13/+13
| | | | | | | | Oh, MSVC.
* | Bare naked merge and rebaseEdward Thomson2013-12-035-13/+317
| |
* | Merge pull request #1977 from ethomson/revertVicent Martí2013-12-0347-0/+484
|\ \ | | | | | | Revert support for a single commit
| * | Introduce git_revert to revert a single commitEdward Thomson2013-12-0247-0/+484
| |/
* | GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds betterRussell Belfer2013-12-021-1/+1
| |
* | Add GIT_DIFF_FIND_DELETE_UNMODIFIED flagRussell Belfer2013-12-021-0/+48
| | | | | | | | | | | | | | | | | | | | When doing copy detection, it is often necessary to include UNMODIFIED records in the git_diff so they are available as source records for GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED. Yet in the final diff, often you will not want to have these UNMODIFIED records. This adds a flag which marks these UNMODIFIED records for deletion from the diff list so they will be removed after the rename detect phase is over.
* | Fix bug making split deltas a COPIED targetsRussell Belfer2013-12-021-0/+49
|/ | | | | | | | When FIND_COPIES is used in combination with BREAK_REWRITES for rename detection, there was a bug where the split MODIFIED delta was only used as a target for RENAME records and not for COPIED records. This fixes that, converting the split into a pair of DELETED and COPIED deltas when that circumstance arises.
* Merge pull request #1966 from nickh/patch_content_offsetsVicent Martí2013-11-191-0/+6
|\ | | | | Add content offset to git_diff_line
| * Add content offset to git_diff_lineNick Hengeveld2013-11-181-0/+6
| | | | | | | | | | | | For additions and deletions, external consumers like subversion can make use of the content offset to generate diffs in their proprietary formats.
* | tests: Drop unrelated commentnulltoken2013-11-191-1/+0
| |
* | tree-cache: Don't segfault upon corruptionnulltoken2013-11-192-0/+9
|/
* Fix warningsRussell Belfer2013-11-181-0/+2
|
* Introduce git_cred_default for NTLM/SPNEGO authEdward Thomson2013-11-181-1/+15
|
* Propagate auth error codes as GIT_EUSER in winhttpEdward Thomson2013-11-181-0/+33
|
* Update files that reference tests-clarBen Straub2013-11-142-2/+2
|
* Rename tests-clar to testsBen Straub2013-11-142062-0/+55912
|
* Backport more test dataVicent Martí2012-05-0266-57/+0
|
* Move test resourcesVicent Martí2012-05-0298-130/+0
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-02111-0/+144
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * Merge pull request #642 from arrbee/mem-poolsRussell Belfer2012-04-252-191/+0
| |\ | | | | | | Memory pools and khash hashtables
| | * Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-252-191/+0
| | | | | | | | | | | | | | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
| * | Include the new config test fileCarlos Martín Nieto2012-04-251-0/+2
| |/
| * Fix warnings on 64-bit windows buildsRussell Belfer2012-04-172-2/+2
| | | | | | | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
| * config: parse quoted valuesCarlos Martín Nieto2012-04-161-0/+7
| | | | | | | | | | Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
| * tag: Add git_tag_peel() which recursively peel a tag until a non tag ↵nulltoken2012-04-104-6/+7
| | | | | | | | git_object is met
| * Merge pull request #610 from arrbee/status-rewriteVicent Martí2012-03-31111-1/+139
| |\ | | | | | | Rewrite status using diff
| | * Fix handling of submodules in treesRussell Belfer2012-03-266-0/+6
| | |
| | * Fix error in tree iterator when popping up treesRussell Belfer2012-03-2513-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an error in the tree iterator where it would delete two tree levels instead of just one when popping up a tree level. Unfortunately the test data for the tree iterator did not have any deep trees with subtrees in the middle of the tree items, so this problem went unnoticed. This contains the 1-line fix plus new test data and tests that reveal the issue.
| | * Restore default status recursion behaviorRussell Belfer2012-03-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | This gives `git_status_foreach()` back its old behavior of emulating the "--untracked=all" behavior of git. You can get any of the various --untracked options by passing flags to `git_status_foreach_ext()` but the basic version will keep the behavior it has always had.
| | * More status testingRussell Belfer2012-03-221-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This "fixes" the broken t18 status tests to accurately reflect the new behavior for "created" untracked subdirectories. See discussion in the PR for more details. This also contains the submodules unit test that I forgot to git add, and ports most of the t18-status.c tests to clar (still missing a couple of the git_status_file() single file tests).
| | * Adding new tests for new status commandRussell Belfer2012-03-2295-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | This is a work in progress. This adds two new sets of tests, the issue_592 tests from @nulltoken's pull request #601 and some new tests for submodules. The submodule tests still have issues where the status is not reported correctly. That needs to be fixed before merge.
| * | test_helpers: fix unepextected closing of file on errornulltoken2012-03-211-1/+2
| |/
| * Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-1/+1
| | | | | | | | | | Also cleaned up some previously converted code that still had little things to polish.
| * error-handling: RepositoryVicent Martí2012-03-071-2/+6
| | | | | | | | | | | | | | | | This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
| * error-handling: ReferencesVicent Martí2012-03-066-22/+32
| | | | | | | | | | Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
* | Merge pull request #606 from benstraub/t04_commit_to_clarVicent Martí2012-04-0253-0/+43
|\ \ | | | | | | Ported t04_commit.c to Clar.
| * | Ported t04_commit.c to Clar.Ben Straub2012-03-2053-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a copy of tests/resources/testrepo.git that is compatible with the Clar sandboxing helpers. Restructured commit test suites to use Clar sandbox helpers. Now using typed data arrays rather than lots of macros to define test cases.
* | | Moved testing resources to clar, and removed old tests directory.Ben Straub2012-03-31275-1297/+0
| | | | | | | | | | | | Removed the BUILD_CLAR CMake flag, and updated the readme.
* | | Removing test suites that have been ported to Clar:Ben Straub2012-03-3116-6178/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * t00 / 6e86fb3 (mentioned in #406) * t01 / fc60c4a (mentioned in #406) * t03 / bcbabe6 * t04 / PR #606 * t05 / d96f2c3 * t06 / 6c106ee * t07 / 2ef582b * t08 / b482c42 * t09 / 9a39a36 * t10 / 00a4893 * t12 / 7c3a4a7 * t13 / 1cb9b31 * t17 / cdaa6ff (mentioned in #406) * t18 / efabc08
* | | t08_tag.c ported.Ben Straub2012-03-3053-0/+43
|/ / | | | | | | Also cleaned up some names for things that used to be macros.