summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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.
* | remote: remove url and pushurl from the save logicCarlos Martín Nieto2015-05-133-12/+20
| | | | | | | | | | | | 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.
* | Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-1313-204/+140
|/ | | | | | | | | | | | | | 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.
* stash_apply: provide progress callbacksEdward Thomson2015-05-111-0/+45
|
* stash_apply: provide its own options structureEdward Thomson2015-05-112-17/+43
|
* stash: test checkout notify callbacksEdward Thomson2015-05-111-0/+52
|
* stash: return GIT_EMERGECONFLICT on merge conflictEdward Thomson2015-05-111-1/+1
|
* stash: refactor to use merge_iteratorsEdward Thomson2015-05-111-12/+12
|
* stash apply: check out a tree, not piecewiseEdward Thomson2015-05-111-2/+2
|
* index: introduce git_index_read_indexEdward Thomson2015-05-111-0/+73
|
* merge: merge iteratorsEdward Thomson2015-05-111-1/+13
|
* Added git_stash_apply() and git_stash_pop() APIsPierre-Olivier Latour2015-05-111-0/+215
|
* Merge pull request #3079 from ethomson/configCarlos Martín Nieto2015-05-041-0/+202
|\ | | | | Configuration changes for handling multiple of the same sections
| * config: test all multivars are updatedEdward Thomson2015-05-041-6/+16
| | | | | | | | | | | | 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.
| * config: use wildcard in test instead of empty exprEdward Thomson2015-05-041-1/+1
| |
| * config: cleanup some now-unused variablesEdward Thomson2015-05-041-2/+0
| |
| * Test setting config var under duplicate header.Ryan Roden-Corrent2015-05-041-0/+49
| | | | | | | | | | | | | | | | | | | | 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.
| * config: examine whole file when writingEdward Thomson2015-05-041-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * config: test overwriting cvar in multiple regionsEdward Thomson2015-05-041-0/+36
| |
| * config: ensure we can write to an empty fileEdward Thomson2015-05-041-0/+72
| |
* | checkout test: better case-insensitive test on MacEdward Thomson2015-05-041-3/+29
| | | | | | | | | | | | | | | | On Mac OS, `realpath` is deficient in determining the actual filename on-disk as it will simply provide the string you gave it if that file exists, instead of returning the filename as it exists. Instead we must read the directory entries for the parent directory to get the canonical filename.
* | status test: always test the new file pathEdward Thomson2015-05-041-8/+12
| |
* | checkout test: only run icase on icase platformEdward Thomson2015-05-042-79/+61
| |