tests


Log

Author Commit Date CI Message
Carlos Martín Nieto 4e636423 2015-05-05T09:01:20 submodule: make `_set_update_fetch_recurse_submodules()` affect the config Similarly to the other ones. In this test we copy over testing `RECURSE_YES` which shows an error in our handling of the `YES` variant which we may have to port to the rest.
Carlos Martín Nieto e8a39f8e 2015-05-05T08:35:29 submodule: make `_set_update()` affect the configuration Moving on with the removal of runtime-changing variables, the update setting for a remote is whatever it was when it was looked up.
Carlos Martín Nieto c6f489c9 2015-05-04T17:29:12 submodule: add an ignore option to status This lets us specify in the status call which ignore rules we want to use (optionally falling back to whatever the submodule has in its configuration). This removes one of the reasons for having `_set_ignore()` set the value in-memory. We re-use the `IGNORE_RESET` value for this as it is no longer relevant but has a similar purpose to `IGNORE_FALLBACK`. Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of initializers and move that to fall back to the configuration as well.
Carlos Martín Nieto 64bbd47a 2015-05-04T17:09:21 submodule: don't let status change an existing instance As submodules are becomes more like values, we should not let a status check to update its properties. Instead of taking a submodule, have status take a repo and submodule name.
Carlos Martín Nieto 5a9fc6c8 2015-05-04T16:22:56 submodule: make set_ignore() affect the configuration Instead of affecting a particular instance, make it change the configuration.
Carlos Martín Nieto dfda2f68 2015-04-27T19:27:29 submodule: remove the per-repo cache Having this cache and giving them out goes against our multithreading guarantees and it makes it impossible to use submodules in a multi-threaded environment, as any thread can ask for a refresh which may reallocate some string in the submodule struct which we've accessed in a different one via a getter. This makes the submodules behave more like remotes, where each object is created upon request and not shared except explicitly by the user. This means that some tests won't pass yet, as they assume they can affect the submodule objects in the cache and that will affect later operations.
Edward Thomson fc656802 2015-06-19T08:31:07 status: test that symlinks don't lose their mode Test to ensure that when status updates an index, it does not alter the original mode for file types that are not supported (eg, symlinks on Windows).
Edward Thomson 9018529b 2015-06-20T14:34:34 Merge pull request #3238 from git-up/double_free Fixed index being double-freed in stash tests
Edward Thomson 883cb642 2015-06-20T14:05:02 Merge pull request #3236 from libgit2/cmn/index-checksum Use the checksum to check whether an index has been modified
Pierre-Olivier Latour 07ea3a7f 2015-06-20T10:57:03 Fixed index being double-freed in stash tests
Carlos Martín Nieto 863dd89a 2015-06-18T12:45:40 tests: tick over five seconds instead of one When ticking over one second, it can happen that the actual time ticks over the same second between the time that we undermine our own race protections and the time in which we perform the index update. Such timing would make the time in the entries match the index' timestamp and we have not gained anything. Ticking over five seconds makes it so that if real-time rolls over that second, our index is still ahead. This is still suboptimal as we're dealing with timing, but five seconds should be long enough for any reasonable test runner to finish the tests.
Carlos Martín Nieto 46c84c72 2015-06-19T21:56:42 index: user a better assertion when comparing sizes This will tell us which numbers we were trying to compare, rather than just telling us that they're different.
Pierre-Olivier Latour 85a5e8eb 2015-06-17T09:00:23 Fixed Xcode 6.1 build warnings
Jeff Hostetler 534d136d 2015-06-17T08:52:28 Fix memory leak in tests/network/refspecs.c
Carlos Martín Nieto a56db992 2015-06-17T08:15:49 Merge pull request #3219 from libgit2/cmn/racy-diff Zero out racily-clean entries' file_size
Edward Thomson fef5344c 2015-06-16T16:34:25 merge::workdir::dirty: tick idx to defeat racy-git
Edward Thomson 121c3171 2015-06-16T15:18:04 Introduce p_utimes and p_futimes Provide functionality to set the time on a filesystem entry, using utimes or futimes on POSIX type systems or SetFileTime on Win32.
Edward Thomson 5f83758f 2015-06-16T10:40:46 Merge pull request #3209 from libgit2/cmn/double-author commit: ignore multiple author fields
Carlos Martín Nieto e44abe16 2015-06-16T08:51:45 tests: tick the index when we count OID calculations These tests want to test that we don't recalculate entries which match the index already. This is however something we force when truncating racily-clean entries. Tick the index forward as we know that we don't perform the modifications which the racily-clean code is trying to avoid.
Carlos Martín Nieto c4e6ab5f 2015-06-15T14:32:08 crlf: tick the index forward to work around racy-git behaviour In order to avoid racy-git, we zero out the file size for entries with the same timestamp as the index (or during the initial checkout). This is the case in a couple of crlf tests, as the code is fast enough to do everything in the same second. As we know that we do not perform the modification just after writing out the index, which is what this is designed to work around, tick the mtime of the index file such that it doesn't agree with the files anymore, and we do not zero out these entries.
Carlos Martín Nieto 77596fcf 2015-06-15T09:51:34 diff: add failing test for racy-git in the index We update the index and then immediately change the contents of the file. This makes the diff think there are no changes, as the timestamp of the file agrees with the cached data. This is however a bug, as the file has obviously changed contents. The test is a bit fragile, as it assumes that the index writing and the following modification of the file happen in the same second, but it's enough to show the issue.
Pierre-Olivier Latour 0f4d9c03 2015-06-15T09:52:40 Fixed Xcode 6.1 build warnings
Carlos Martín Nieto d4723c89 2015-06-15T08:17:45 Merge pull request #3177 from ethomson/binary_diff Binary diffs: store deltas in the diff structure, include binary data in diff callbacks
Carlos Martín Nieto ae22ef0e 2015-06-15T08:09:21 Merge pull request #3217 from jeffhostetler/leak_checkout_icase Fix leaks in tests/checkout/icase
Jeff Hostetler 26d5c0b8 2015-06-12T09:28:47 Fix leaks in tests/checkout/icase
Edward Thomson 391281ae 2015-06-02T18:26:22 binary diff: test binary blob to blob tests
Edward Thomson 8147b1af 2015-05-25T20:03:59 diff: introduce binary diff callbacks Introduce a new binary diff callback to provide the actual binary delta contents to callers. Create this data from the diff contents (instead of directly from the ODB) to support binary diffs including the workdir, not just things coming out of the ODB.
Edward Thomson ac7012a8 2015-05-25T20:36:29 binary diff: test index->workdir binary diffs
Carlos Martín Nieto 352ee171 2015-06-12T12:45:49 clone: set the credentials callback during testing
Carlos Martín Nieto 0f69b41d 2015-06-12T12:25:25 push: pass the callbacks during setup as well We need to pass these options in order to have the credentials callback set.
Carlos Martín Nieto 65d69fe8 2015-06-11T08:24:58 commit: ignore multiple author fields Some tools create multiple author fields. git is rather lax when parsing them, although fsck does complain about them. This means that they exist in the wild. As it's not too taxing to check for them, and there shouldn't be a noticeable slowdown when dealing with correct commits, add logic to skip over these extra fields when parsing the commit.
Edward Thomson 2eecc288 2015-06-10T14:43:49 Introduce `git_filter_list_contains` `git_filter_list_contains` can be used to query a filter list to determine if a given filter will be run.
Carlos Martín Nieto 82a7a24c 2015-06-08T15:22:01 Merge pull request #3165 from ethomson/downcase Downcase
Carlos Martín Nieto b6011e29 2015-06-07T15:10:28 Merge pull request #3185 from libgit2/cmn/foreach-cancel-loose path: error out if the callback returns an error
Carlos Martín Nieto 8da44047 2015-06-06T03:55:28 path: error out if the callback returns an error When the callback returns an error, we should stop immediately. This broke when trying to make sure we pass specific errors up the chain. This broke cancelling out of the loose backend's foreach.
Pierre-Olivier Latour 9f3c18e2 2015-06-02T08:36:15 Fixed build warnings on Xcode 6.1
Patrick Steinhardt 9e88a823 2015-05-21T13:02:22 remote: test insteadOf for anonymous remotes
Patrick Steinhardt ec0c4c40 2015-05-04T11:59:20 remote: apply insteadOf configuration. A remote's URLs are now modified according to the url.*.insteadOf and url.*.pushInsteadOf configurations. This allows a user to replace URL prefixes by setting the corresponding keys. E.g. "url.foo.insteadOf = bar" would replace the prefix "bar" with the new prefix "foo".
Edward Thomson bad33a5d 2015-05-29T17:39:11 git__tolower: test that some non-ASCII downcasing isn't
Edward Thomson 006548da 2015-05-29T16:07:51 git__strcasecmp: treat input bytes as unsigned Treat input bytes as unsigned before doing arithmetic on them, lest we look at some non-ASCII byte (like a UTF-8 character) as a negative value and perform the comparison incorrectly.
Carlos Martín Nieto 2c8550f0 2015-05-29T19:38:11 Merge pull request #3157 from mgorny/ssh_memory_auth Support getting SSH keys from memory, pt. 2
Edward Thomson 885b94aa 2015-05-28T15:26:13 Rename GIT_EMERGECONFLICT to GIT_ECONFLICT We do not error on "merge conflicts"; on the contrary, merge conflicts are a normal part of merging. We only error on "checkout conflicts", where a change exists in the index or the working directory that would otherwise be overwritten by performing the checkout. This *may* happen during merge (after the production of the new index that we're going to checkout) but it could happen during any checkout.
Carlos Martín Nieto ff8d635a 2015-05-28T18:45:57 Merge pull request #3139 from ethomson/diff_conflicts Include conflicts when diffing
Edward Thomson fb92b48d 2015-05-28T10:13:07 Merge pull request #3149 from libgit2/cmn/upstream-matching-push Fill the pointers for matching refspecs
Carlos Martín Nieto 2b922832 2015-05-28T16:09:17 Merge pull request #3127 from libgit2/cmn/remote-fixups Tackle remote API issues from bindings
Edward Thomson 666ae188 2015-05-19T17:52:13 git_index_add_all: test that conflicts are handled When confronted with a conflict in the index, `git_index_add_all` should stage the working directory copy. If there is no file in the working directory, the conflict should simply be removed.
Edward Thomson 1c4b5cee 2015-05-19T17:51:13 Introduce cl_git_sandbox_init_new() cl_git_sandbox_init_new() will create a clar temp directory and initialize a new repository at that location.
Edward Thomson 9f545b9d 2015-05-19T11:23:59 introduce `git_index_entry_is_conflict` 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.
Edward Thomson 2f1080ea 2015-05-19T11:17:07 conflict tests: use GIT_IDXENTRY_STAGE_SET
Edward Thomson 191e97a0 2015-05-18T18:15:17 diff conflicts: don't include incorrect ID Since a diff entry only concerns a single entry, zero the information for the index side of a conflict. (The index entry would otherwise erroneously include the lowest-stage index entry - generally the ancestor of a conflict.) Test that during status, the index side of the conflict is empty.
Edward Thomson b22369ef 2015-05-18T17:01:37 diff conflicts: test index to workdir w/ conflicts
Edward Thomson bb815157 2015-05-18T16:23:13 diff conflicts: add tests for tree to index
Edward Thomson 7c948014 2015-05-14T14:00:29 diff/status: introduce conflicts When diffing against an index, return a new `GIT_DELTA_CONFLICTED` delta type for items that are conflicted. For a single file path, only one delta will be produced (despite the fact that there are multiple entries in the index). Index iterators now have the (optional) ability to return conflicts in the index. Prior to this change, they would be omitted, and callers (like diff) would omit conflicted index entries entirely.
Edward Thomson d67f270e 2015-05-14T13:30:29 index: validate mode of new conflicts
Edward Thomson ecd60a56 2015-05-14T11:52:48 conflicts: when adding conflicts, remove staged When adding a conflict for some path, remove the staged entry. Otherwise, an illegal index (with both stage 0 and high-stage entries) would result.
Carlos Martín Nieto c6e942fb 2015-05-17T15:19:22 remote: validate refspecs before adding to config When we moved from acting on the instance to acting on the configuration, we dropped the validation of the passed refspec, which can lead to writing an invalid refspec to the configuration. Bring that validation back.
Carlos Martín Nieto ae5b9362 2015-05-17T15:11:45 remote: remove fetch parameter from create_anonymous An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
Michał Górny 8085adf8 2015-05-27T18:44:40 test: Add a test for in-memory SSH private key cred_cb
Colomban Wendling 1ecbcd8e 2015-05-26T19:16:27 Fix ident replacement to match Git behavior Git inserts a space after the SHA1 (as of 2.1.4 at least), so do the same.
Carlos Martín Nieto 5014fe95 2015-05-22T12:24:09 branch: error out if we cannot find the remote When we look for which remote corresponds to a remote-tracking branch, we look in the refspecs to see which ones matches. If none do, we should abort. We currently ignore the error message from this operation, so let's not do that anymore. As part of the test we're writing, let's test for the expected behaviour if we cannot find a refspec which tells us what the remote-tracking branch for a remote would look like.
Carlos Martín Nieto 7cd4ba1b 2015-05-22T12:11:42 refspec: make sure matching refspecs have src, dst and input strings When we find out that we're dealing with a matching refspec, we set the flag and return immediately. This leaves the strings as NULL, which breaks the contract. Assign these pointers to a string with the correct values.
Carlos Martín Nieto 6675aaba 2015-05-21T04:58:16 Merge pull request #3146 from ethomson/add_untracked_files index_add_all: include untracked files in new subdirs
Edward Thomson fa9a969d 2015-05-20T18:22:17 index_add_all: include untracked files in new subdirs
Carlos Martín Nieto 2c57114f 2015-05-20T21:18:25 ignore: clear the error when matching a pattern negation When we discover that we want to keep a negative rule, make sure to clear the error variable, as it we otherwise return whatever was left by the previous loop iteration.
Edward Thomson acc573cb 2015-05-19T14:12:40 Merge pull request #3109 from libgit2/cmn/index-use-diff Use a diff for iteration in index_update_all and index_add_all
Carlos Martín Nieto 7b5ce2e5 2015-05-14T09:33:54 clone: don't rely on auto-saving for single-branch The code used to rely on the clone code calling the remote's save, which does not happen anymore, meaning that the configuration settings the remote expected were not being written to disk. The run-time configuration was still being affected, so the right branch was being cloned. The tests continued to pass as we did not check for the configuration entires. Fix this by creating the remote with the single-branch refspec we want and checking for its existence in the configuration.
Carlos Martín Nieto 2b2dfe80 2015-05-12T12:07:33 index: include TYPECHANGE in the diff Without this option, we would not be able to catch exec bit changes.
Carlos Martín Nieto 041ad7db 2015-05-14T10:34:05 push: add tests for the push negotiation callback The functionality was meged without including tests, so let's add them now.
Carlos Martín Nieto 16d742eb 2015-05-13T21:43:58 Merge pull request #3119 from ethomson/ignore Attributes: don't match files for folders
Edward Thomson cd430bc7 2015-05-13T14:26:20 Merge pull request #3103 from libgit2/cmn/local-push-message Use the packbuilder in local push
Edward Thomson 882cc37f 2015-05-13T10:56:55 attr tests: make explicit our dir/file match tests
Carlos Martín Nieto 3e529e9d 2015-05-13T16:12:45 Fix a few leaks The interesting one is the notification macro, which was returning directly on a soft-abort instead of going through the cleanup.
Edward Thomson 6cd92193 2015-05-13T09:07:15 Merge pull request #3115 from libgit2/cmn/clone-submodule submodule: add test initialising and cloning a repo
Carlos Martín Nieto 0bc3d56d 2015-05-07T16:12:36 tests: don't push to our resources A couple of tests use the wrong remote to push to. We did not notice up to now because the local push would copy individual objects, and those already existed, so it became a no-op. Once we made local push create the packfile, it became noticeable that there was a new packfile where it didn't belong.
Carlos Martín Nieto a4b6452a 2015-04-23T06:55:29 remote: remove git_remote_save() It has now become a no-op, so remove the function and all references to it.
Carlos Martín Nieto 77254990 2015-04-23T06:51:34 remote: remove live changing of refspecs The base refspecs changing can be a cause of confusion as to what is the current base refspec set and complicate saving the remote's configuration. Change `git_remote_add_{fetch,push}()` to update the configuration instead of an instance. This finally makes `git_remote_save()` a no-op, it will be removed in a later commit.
Carlos Martín Nieto 35a8a8c5 2015-04-22T17:29:20 remote: move the tagopt setting to the fetch options This is another option which we should not be keeping in the remote, but is specific to each particular operation.
Carlos Martín Nieto 3eff2a57 2015-04-22T16:11:10 remote: move the update_fetchhead setting to the options While this will rarely be different from the default, having it in the remote adds yet another setting it has to keep around and can affect its behaviour. Move it to the options.
Carlos Martín Nieto 058b753c 2015-04-22T15:45:21 remote: move the transport ctor to the callbacks Instead of having it set in a different place from every other callback, put it the main structure. This removes some state from the remote and makes it behave more like clone, where the constructors are passed via the options.
Carlos Martín Nieto 22261344 2015-04-22T04:38:08 remote: remove url and pushurl from the save logic As a first step in removing the repository-saving logic, don't allow chaning the url or push url from a remote object, but change the configuration on the configuration immediately.
Carlos Martín Nieto 8f0104ec 2015-04-21T22:10:36 Remove the callbacks struct from the remote Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
Edward Thomson 9486d203 2015-05-12T13:07:59 attr test: test a file beneath ignored folder
Edward Thomson 97fb9ac7 2015-05-12T13:54:28 attr: test that a file is not ignored for a folder When a .gitignore specifies some folder "foo/", ensure that a file with the same name "foo" is not ignored.
Edward Thomson adad5181 2015-05-12T13:52:47 attr: regression tests for ignore matching Ensure that when examining a .gitignore in a subdirectory, we do not erroneously apply the paths contained therein to the root of the repository. (Fixed in c02a0e4).
Carlos Martín Nieto 1e44ea97 2015-05-12T11:13:41 submodule: add test initialising and cloning a repo We have a few tests checking each step, but we do not yet have a test which tests the documented workflow for creating a submodule, namely `setup_add` followed by cloning into it, followed by `add_finalize`. Add such a test to protect against regressions in this workflow.
Edward Thomson 4ea3eebf 2015-05-01T18:34:38 stash_apply: provide progress callbacks
Edward Thomson 19c80a6f 2015-05-01T18:07:10 stash_apply: provide its own options structure
Edward Thomson 24961668 2015-04-20T20:06:02 stash: test checkout notify callbacks
Edward Thomson f78bb2af 2015-03-18T01:54:04 stash: return GIT_EMERGECONFLICT on merge conflict
Edward Thomson f0957589 2015-03-04T23:55:42 stash: refactor to use merge_iterators
Edward Thomson d0dd3fce 2015-02-18T15:16:05 stash apply: check out a tree, not piecewise
Edward Thomson 35d39761 2015-03-18T00:25:18 index: introduce git_index_read_index
Edward Thomson 9ebb5a3f 2015-02-18T22:53:40 merge: merge iterators
Pierre-Olivier Latour bf8dd3f5 2014-11-14T12:32:47 Added git_stash_apply() and git_stash_pop() APIs
Carlos Martín Nieto 074d323f 2015-05-04T15:23:40 Merge pull request #3079 from ethomson/config Configuration changes for handling multiple of the same sections
Edward Thomson d6b7e404 2015-05-04T07:36:21 config: test all multivars are updated If a multivar exists within two sections (of the same name) then they should both be updated in a `set_multivar`. Ensure that this is the case.
Edward Thomson 0daf998d 2015-04-27T16:31:18 config: use wildcard in test instead of empty expr
Edward Thomson 63c0cc65 2015-04-27T16:29:00 config: cleanup some now-unused variables
Ryan Roden-Corrent 5a70df94 2015-04-21T15:57:20 Test setting config var under duplicate header. Add a test that exposes a bug in config_write. It is valid to have multiple separate headers for the same config section, but config_write will exit after finding the first matching section in certain situations. This test proves that config_write will duplicate a variable that already exists instead of overwriting it if the variable is defined under a duplicate section header.
Edward Thomson bf99390e 2015-04-23T16:54:36 config: examine whole file when writing Previously we would try to be clever when writing the configuration file and try to stop parsing (and simply copy the rest of the old file) when we either found the value we were trying to write, or when we left the section that value was in, the assumption being that there was no more work to do. Regrettably, you can have another section with the same name later in the file, and we must cope with that gracefully, thus we read the whole file in order to write a new file. Now, writing a file looks even more than reading. Pull the config parsing out into its own function that can be used by both reading and writing the configuration.