summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * git__tolower: test that some non-ASCII downcasing isn'tEdward Thomson2015-05-291-0/+4
| |
| * git__strcasecmp: treat input bytes as unsignedEdward Thomson2015-05-291-0/+38
| | | | | | | | | | | | 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.
* | Merge pull request #3185 from libgit2/cmn/foreach-cancel-looseCarlos Martín Nieto2015-06-071-0/+20
|\ \ | | | | | | path: error out if the callback returns an error
| * | path: error out if the callback returns an errorcmn/foreach-cancel-looseCarlos Martín Nieto2015-06-061-0/+20
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-026-9/+14
|/ /
* | remote: test insteadOf for anonymous remotesPatrick Steinhardt2015-05-311-0/+12
| |
* | remote: apply insteadOf configuration.Patrick Steinhardt2015-05-312-0/+72
| | | | | | | | | | | | | | | | 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".
* | Merge pull request #3157 from mgorny/ssh_memory_authCarlos Martín Nieto2015-05-291-0/+68
|\ \ | | | | | | Support getting SSH keys from memory, pt. 2
| * | test: Add a test for in-memory SSH private key cred_cbMichał Górny2015-05-271-0/+68
| | |
* | | Rename GIT_EMERGECONFLICT to GIT_ECONFLICTEdward Thomson2015-05-292-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #3139 from ethomson/diff_conflictsCarlos Martín Nieto2015-05-2817-80/+374
|\ \ \ | | | | | | | | Include conflicts when diffing
| * | | git_index_add_all: test that conflicts are handledEdward Thomson2015-05-281-49/+104
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Introduce cl_git_sandbox_init_new()Edward Thomson2015-05-282-0/+9
| | | | | | | | | | | | | | | | | | | | cl_git_sandbox_init_new() will create a clar temp directory and initialize a new repository at that location.
| * | | introduce `git_index_entry_is_conflict`Edward Thomson2015-05-283-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | conflict tests: use GIT_IDXENTRY_STAGE_SETEdward Thomson2015-05-287-26/+26
| | | |
| * | | diff conflicts: don't include incorrect IDEdward Thomson2015-05-281-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | diff conflicts: test index to workdir w/ conflictsEdward Thomson2015-05-281-0/+45
| | | |
| * | | diff conflicts: add tests for tree to indexEdward Thomson2015-05-283-2/+78
| | | |
| * | | diff/status: introduce conflictsEdward Thomson2015-05-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | index: validate mode of new conflictsEdward Thomson2015-05-282-1/+14
| | | |
| * | | conflicts: when adding conflicts, remove stagedEdward Thomson2015-05-282-1/+51
| | |/ | |/| | | | | | | | | | | | | 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.
* | | Merge pull request #3149 from libgit2/cmn/upstream-matching-pushEdward Thomson2015-05-282-0/+42
|\ \ \ | | | | | | | | Fill the pointers for matching refspecs
| * | | branch: error out if we cannot find the remotecmn/upstream-matching-pushCarlos Martín Nieto2015-05-221-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | refspec: make sure matching refspecs have src, dst and input stringsCarlos Martín Nieto2015-05-221-0/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #3127 from libgit2/cmn/remote-fixupsCarlos Martín Nieto2015-05-283-26/+21
|\ \ \ | |_|/ |/| | Tackle remote API issues from bindings
| * | remote: validate refspecs before adding to configCarlos Martín Nieto2015-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | 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.
| * | remote: remove fetch parameter from create_anonymousCarlos Martín Nieto2015-05-282-16/+6
| | | | | | | | | | | | | | | | | | An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
| * | clone: don't rely on auto-saving for single-branchCarlos Martín Nieto2015-05-171-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix ident replacement to match Git behaviorColomban Wendling2015-05-264-15/+15
| |/ |/| | | | | | | Git inserts a space after the SHA1 (as of 2.1.4 at least), so do the same.
* | Merge pull request #3146 from ethomson/add_untracked_filesCarlos Martín Nieto2015-05-211-0/+23
|\ \ | | | | | | index_add_all: include untracked files in new subdirs
| * | index_add_all: include untracked files in new subdirsEdward Thomson2015-05-201-0/+23
| | |
* | | ignore: clear the error when matching a pattern negationcmn/ignored-ignoreCarlos Martín Nieto2015-05-201-0/+12
|/ / | | | | | | | | | | 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.
* | Merge pull request #3109 from libgit2/cmn/index-use-diffEdward Thomson2015-05-191-0/+13
|\ \ | |/ |/| Use a diff for iteration in index_update_all and index_add_all
| * index: include TYPECHANGE in the diffCarlos Martín Nieto2015-05-141-0/+13
| | | | | | | | Without this option, we would not be able to catch exec bit changes.
* | push: add tests for the push negotiation callbackCarlos Martín Nieto2015-05-141-0/+114
|/ | | | | The functionality was meged without including tests, so let's add them now.
* Merge pull request #3119 from ethomson/ignoreCarlos Martín Nieto2015-05-131-1/+62
|\ | | | | Attributes: don't match files for folders
| * attr tests: make explicit our dir/file match testsEdward Thomson2015-05-131-12/+24
| |
| * attr test: test a file beneath ignored folderEdward Thomson2015-05-121-1/+1
| |
| * attr: test that a file is not ignored for a folderEdward Thomson2015-05-121-0/+17
| | | | | | | | | | When a .gitignore specifies some folder "foo/", ensure that a file with the same name "foo" is not ignored.
| * attr: regression tests for ignore matchingEdward Thomson2015-05-121-0/+32
| | | | | | | | | | | | 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).
* | Merge pull request #3103 from libgit2/cmn/local-push-messageEdward Thomson2015-05-131-2/+2
|\ \ | | | | | | Use the packbuilder in local push
| * | tests: don't push to our resourcescmn/local-push-messageCarlos Martín Nieto2015-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix a few leaksCarlos Martín Nieto2015-05-132-0/+3
| | | | | | | | | | | | | | | The interesting one is the notification macro, which was returning directly on a soft-abort instead of going through the cleanup.
* | | Merge pull request #3115 from libgit2/cmn/clone-submoduleEdward Thomson2015-05-131-0/+55
|\ \ \ | |/ / |/| | submodule: add test initialising and cloning a repo
| * | submodule: add test initialising and cloning a repocmn/clone-submoduleCarlos Martín Nieto2015-05-121-0/+55
| |/ | | | | | | | | | | | | | | 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.
* | remote: remove git_remote_save()Carlos Martín Nieto2015-05-131-12/+0
| | | | | | | | | | It has now become a no-op, so remove the function and all references to it.
* | remote: remove live changing of refspecsCarlos Martín Nieto2015-05-136-84/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | remote: move the tagopt setting to the fetch optionsCarlos Martín Nieto2015-05-134-24/+20
| | | | | | | | | | This is another option which we should not be keeping in the remote, but is specific to each particular operation.
* | remote: move the update_fetchhead setting to the optionsCarlos Martín Nieto2015-05-132-4/+4
| | | | | | | | | | | | 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.
* | remote: move the transport ctor to the callbacksCarlos Martín Nieto2015-05-134-12/+12
| | | | | | | | | | | | | | 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.