tests


Log

Author Commit Date CI Message
Edward Thomson 0ef19fe1 2014-01-20T17:13:55 Merge submodules
Edward Thomson db3462ce 2014-01-19T22:36:50 Support union merges
Edward Thomson 0e1ba46c 2014-01-19T20:03:13 Remove the "merge none" flag The "merge none" (don't automerge) flag was only to aide in merge trivial tests. We can easily determine whether merge trivial resulted in a trivial merge or an automerge by examining the REUC after automerge has completed.
Edward Thomson 6891a862 2014-01-19T18:12:22 Load merge.conflictstyle setting from config
Edward Thomson e651e8e2 2014-01-19T15:05:08 Introduce diff3 mode for checking out conflicts
Edward Thomson 6b92c99b 2014-01-19T01:20:25 Don't try to merge binary files
Edward Thomson c1d648c5 2014-01-08T18:29:42 merge_file should use more aggressive levels The default merge_file level was XDL_MERGE_MINIMAL, which will produce conflicts where there should not be in the case where both sides were changed identically. Change the defaults to be more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively compress non-conflicts. This matches git.git's defaults. Increase testing around reverting a previously reverted commit to illustrate this problem.
Edward Thomson b554ca5d 2014-01-20T15:12:06 "Uninitialized" submodules are "unmodified" Extend the "unmodified" submodule workdir test to include uninitialized submodules, to prevent reporting submodules as modified when they're not in the workdir at all.
Patrick Reynolds abdaf936 2014-01-20T11:42:12 add unit tests for git_buf_join corner cases
Carlos Martín Nieto 0b28217b 2014-01-15T12:51:31 refs: remove the _with_log differentiation Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
Arthur Schreiber 40ef47dd 2014-01-14T21:03:01 Add `git_remote_dup`.
Ben Straub 426d8456 2014-01-08T19:43:31 Merge pull request #2033 from xtao/blame_orig_commit Add orig_commit.
XTao b92b434f 2014-01-09T11:18:38 Add orig & final commit test.
Edward Thomson 6adcaab7 2014-01-08T10:07:30 Handle git_buf's from users more liberally
Vicent Marti f3a302ad 2014-01-02T05:10:04 Merge pull request #2019 from linquize/recurse-on-demand Accept 'submodule.*.fetchRecurseSubmodules' config 'on-demand' value
Marek Šuppa f38cb981 2013-12-31T11:27:32 Updated fetch.c test to pass. I am not sure why there was 6 in the first place.
Linquize 41ceab25 2013-12-29T11:21:13 Update test related to fetchRecurseSubmodules
Vicent Marti 4e1f517c 2013-12-18T09:33:45 Merge pull request #1920 from libgit2/cmn/ref-with-log Reference operations with log
Edward Thomson bf4a577c 2013-12-13T10:10:32 Overwrite ignored directories on checkout
Edward Thomson 81a2012d 2013-12-12T11:30:50 Overwrite ignored files on checkout
Vicent Marti 7a16d54b 2013-12-13T12:47:51 pool: Agh, this test doesn't really apply in 32-bit machines The size_t is 32-bit already, so it overflows before going into the function. The `-1` test should handle this gracefully in both cases anyway.
Vicent Marti 437f7d69 2013-12-13T12:41:22 pool: Correct overflow checks Ok, scrap the previous commit. This is the right overflow check that takes care of 64 bit overflow **and** 32-bit overflow, which needs to be considered because the pool malloc can only allocate 32-bit elements in one go.
Russell Belfer 452c7de6 2013-12-12T14:16:40 Add git_treebuilder_insert test and clarify doc This wasn't being tested and since it has a callback, I fixed it even though the return value of this callback is not treated like any of the other callbacks in the API.
Russell Belfer 11bd7a03 2013-12-12T11:14:51 More tests of canceling from callbacks This covers diff print, push, and ref foreach. This also has a fix for a small memory leak in the push tests.
Russell Belfer 7697e541 2013-12-11T15:02:20 Test cancel from indexer progress callback This adds tests that try canceling an indexer operation from within the progress callback. After writing the tests, I wanted to run this under valgrind and had a number of errors in that situation because mmap wasn't working. I added a CMake option to force emulation of mmap and consolidated the Amiga-specific code into that new place (so we don't actually need separate Amiga code now, just have to turn on -DNO_MMAP). Additionally, I made the indexer code propagate error codes more reliably than it used to.
Russell Belfer 8b22d862 2013-12-11T11:55:00 More improvements to callback return value tests This time actually checking return values in diff notify tests and actually testing callbacks for the index all-all/update-all/etc functions.
Russell Belfer 8046b26c 2013-12-10T16:16:36 Try a test that won't assert on Linux
Russell Belfer 8f1066a0 2013-12-10T16:02:24 Update clone doc and tests for callback return val Clone callbacks can return non-zero values to cancel the clone. This adds some tests to verify that this actually works and updates the documentation to be clearer that this can happen and that the return value will be propagated back by the clone function.
Russell Belfer cbd04896 2013-12-10T14:38:35 Fix checkout notify callback docs and tests 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.
Russell Belfer 19853bdd 2013-12-10T13:01:34 Update git_blob_create_fromchunks callback behavr 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.
Russell Belfer 25e0b157 2013-12-06T15:07:57 Remove converting user error to GIT_EUSER 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.
Russell Belfer dab89f9b 2013-12-04T21:22:57 Further EUSER and error propagation fixes 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.
Russell Belfer 96869a4e 2013-12-03T16:45:39 Improve GIT_EUSER handling 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.
Russell Belfer 0eedacb0 2013-12-11T10:39:36 Merge pull request #1985 from libgit2/diff-rename-config Rename detection using diff.renames
Edward Thomson 5588f073 2013-12-09T10:25:36 Clean up warnings
Carlos Martín Nieto f2105129 2013-11-23T14:39:53 refs: expose has_log() on the backend The frontend used to look at the file directly, but that's obviously not the right thing to do. Expose it on the backend and use that function instead.
Carlos Martín Nieto 8d5ec910 2013-11-23T14:13:01 refs: expose a way to ensure a ref has a log Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
Carlos Martín Nieto 6f13a305 2013-11-17T23:26:49 reflog: write to the reflog following git's rules git-core only writes to the reflogs of HEAD, refs/heads/ and, refs/notes/ or if there is already a reflog in place. Adjust our code to follow these semantics.
Ben Straub 7fb4147f 2013-12-06T13:38:59 Don't clobber whitespace settings
Ben Straub 628e92cd 2013-12-05T14:47:04 Don't use weird return codes
Ben Straub c56c6d69 2013-12-05T14:13:46 Implement GIT_DIFF_FIND_BY_CONFIG
Edward Thomson d192e60b 2013-12-03T10:47:18 Reorder var decls in revert test Oh, MSVC.
Edward Thomson eac938d9 2013-12-02T14:10:04 Bare naked merge and rebase
Vicent Martí db0a7e39 2013-12-03T02:11:55 Merge pull request #1977 from ethomson/revert Revert support for a single commit
Edward Thomson 300d192f 2013-12-02T11:15:27 Introduce git_revert to revert a single commit
Russell Belfer f62c174d 2013-12-02T13:49:58 GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better
Russell Belfer 97ad85b8 2013-12-02T13:30:05 Add GIT_DIFF_FIND_DELETE_UNMODIFIED flag 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.
Russell Belfer 2123a17f 2013-12-02T13:27:06 Fix bug making split deltas a COPIED targets 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.
Carlos Martín Nieto 13c9e44a 2013-11-14T19:41:09 reflog: remove git_reflog_append_to() This was a convenience method for the refs front-end to do the reflog writing. This is now done in the backend and it has no more reason for being.
Carlos Martín Nieto a57dd3b7 2013-11-13T18:15:20 reflog: integrate into the ref writing Whenever a reference is created or updated, we need to write to the reflog regardless of whether the user gave us a message, so we shouldn't leave that to the ref frontend, but integrate it into the backend. This also eliminates the race between ref update and writing to the reflog, as we protect the reflog with the ref lock. As an additional benefit, this reflog append on the backend happens by appending to the file instead of parsing and rewriting it.
Carlos Martín Nieto a6b50808 2013-10-30T17:24:36 refs: adjust to the new reflog API
nulltoken ca84e058 2013-05-14T16:40:09 refs: Introduce git_reference_symbolic_set_target_with_log()
nulltoken 14ab0e10 2013-05-14T16:07:33 refs: Introduce git_reference_set_target_with_log()
nulltoken 56ad3782 2013-05-13T17:44:39 refs: Introduce git_reference_symbolic_create_with_log()
nulltoken bba25f39 2013-05-13T16:21:09 refs: Introduce git_reference_create_with_log()
Vicent Martí e479628a 2013-11-19T11:36:02 Merge pull request #1966 from nickh/patch_content_offsets Add content offset to git_diff_line
nulltoken 65f67857 2013-11-19T14:25:30 tests: Drop unrelated comment
nulltoken 3d523345 2013-11-19T13:15:47 tree-cache: Don't segfault upon corruption
Nick Hengeveld d8e7ffc2 2013-11-18T14:03:25 Add content offset to git_diff_line For additions and deletions, external consumers like subversion can make use of the content offset to generate diffs in their proprietary formats.
Russell Belfer 8f2a3d62 2013-11-18T12:14:50 Fix warnings
Edward Thomson 84efffc3 2013-11-13T16:57:51 Introduce git_cred_default for NTLM/SPNEGO auth
Edward Thomson 80fc7d6b 2013-11-13T16:46:45 Propagate auth error codes as GIT_EUSER in winhttp
Ben Straub 83e1efbf 2013-11-14T14:10:32 Update files that reference tests-clar
Ben Straub 17820381 2013-11-14T14:05:52 Rename tests-clar to tests
Ben Straub 92ad5a5c 2012-05-11T11:50:54 Rebasing onto libgit2/development: cleanup.
Ben Straub 46c2ead0 2012-05-10T13:39:34 Now properly handling branches with "-g" in their names.
Ben Straub a346992f 2012-05-10T09:47:14 Rev-parse: @{time} syntax. Ported date.c (for approxidate_careful) from git.git revision aa39b85. Trimmed out the parts we're not using.
Ben Straub a6346302 2012-05-03T13:58:46 Rev-parse: "ref@{upstream}" syntax. Added tracking configuration to the test repo's config to support unit tests.
Ben Straub a51bdbcf 2012-04-30T20:21:45 Implementing rev-parse's ref@{n} and @{-n} syntaxes. Added some reflags to the test repo to support unit tests.
Ben Straub 9d7bdf71 2012-04-26T18:15:43 Implemented rev-parse's "^{}" syntax.
Vicent Martí a1d08025 2012-05-02T16:33:26 Backport more test data
Vicent Martí 8c83fead 2012-05-02T16:18:55 Move test resources
Vicent Martí 40879fac 2012-05-02T15:59:02 Merge branch 'new-error-handling' into development 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
Russell Belfer 3fc5c65d 2012-04-25T15:24:05 Merge pull request #642 from arrbee/mem-pools Memory pools and khash hashtables
Russell Belfer c2b67043 2012-04-25T15:20:28 Rename git_khash_str to git_strmap, etc. 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`.
Carlos Martín Nieto 19dd4e28 2012-04-25T20:42:33 Include the new config test file
Russell Belfer 44ef8b1b 2012-04-13T13:00:10 Fix warnings on 64-bit windows builds This fixes all the warnings on win64 except those in deps, which come from the regex code.
Carlos Martín Nieto 2c1075d6 2012-03-16T12:52:49 config: parse quoted values Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
nulltoken 3f46f313 2012-04-06T14:34:26 tag: Add git_tag_peel() which recursively peel a tag until a non tag git_object is met
Vicent Martí 16eaa150 2012-04-02T17:24:16 Merge pull request #606 from benstraub/t04_commit_to_clar Ported t04_commit.c to Clar.
Ben Straub fd29cd13 2012-03-31T16:10:01 Moved testing resources to clar, and removed old tests directory. Removed the BUILD_CLAR CMake flag, and updated the readme.
Ben Straub 9297b6e0 2012-03-31T14:06:53 Removing test suites that have been ported to Clar: * 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
Vicent Martí 9273399b 2012-03-31T08:23:37 Merge pull request #610 from arrbee/status-rewrite Rewrite status using diff
Ben Straub b482c420 2012-03-28T23:02:02 t08_tag.c ported. Also cleaned up some names for things that used to be macros.
Russell Belfer 277e3041 2012-03-26T11:22:27 Fix handling of submodules in trees
Russell Belfer 875bfc5f 2012-03-25T21:26:48 Fix error in tree iterator when popping up trees 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.
Russell Belfer c8838ee9 2012-03-23T11:03:01 Restore default status recursion behavior 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.
Russell Belfer a56aacf4 2012-03-22T12:03:30 More status testing 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).
Russell Belfer 95340398 2012-03-22T09:17:34 Adding new tests for new status command 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.
nulltoken e285bdc9 2012-03-21T08:10:40 test_helpers: fix unepextected closing of file on error
Ben Straub e0799b6c 2012-03-19T21:41:29 Ported t04_commit.c to Clar. 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.
Russell Belfer 0d0fa7c3 2012-03-16T15:56:01 Convert attr, ignore, mwindow, status to new errors Also cleaned up some previously converted code that still had little things to polish.
Vicent Martí cb8a7961 2012-03-07T00:02:55 error-handling: Repository 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.
Authmillenon 5621d809 2012-03-06T17:51:04 Rename git_oid_to_string to git_oid_tostr To conform the naming scheme of git_oid_fromstr we should change the name of git_oid_to_string to git_oid_tostr.
Vicent Martí 1a481123 2012-02-17T00:13:34 error-handling: References Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
Russell Belfer e1bcc191 2012-03-01T11:45:00 Revert GIT_STATUS constants to avoid issues This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly.
Russell Belfer 854eccbb 2012-02-29T12:04:59 Clean up GIT_UNUSED macros on all platforms It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
Russell Belfer 74fa4bfa 2012-02-28T16:14:47 Update diff to use iterators This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
Russell Belfer caf71ec0 2012-02-07T15:30:18 Add tests and fix bugs for diff whitespace options Once I added tests for the whitespace handling options of diff, I realized that there were some bugs. This fixes those and adds the new tests into the test suite.
Russell Belfer 2705576b 2012-01-24T14:06:42 Simplify GIT_UNUSED macros Since casting to void works to eliminate errors with unused parameters on all platforms, avoid the various special cases. Over time, it will make sense to eliminate the GIT_UNUSED macro completely and just have GIT_UNUSED_ARG.