summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | ssh: skip the localhost cert check earliercmn/host-cert-infoCarlos Martín Nieto2014-09-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skip it before we attempt to clone, as we would exit with -1 on systems which do not have sshd running.
| * | | | | | ssh: expose both hashesCarlos Martín Nieto2014-09-161-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user may have the data hashed as MD5 or SHA-1, so we should provide both types for consumption.
| * | | | | | ssh: provide our own types for host key lengthsCarlos Martín Nieto2014-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the libssh2 defines, provide our own, which eases usage as we do not need to check whether libgit2 was built with libssh2 or not.
| * | | | | | net: use only structs to pass information about certCarlos Martín Nieto2014-09-161-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of spreading the data in function arguments, some of which aren't used for ssh and having a struct only for ssh, use a struct for both, using a common parent to pass to the callback.
| * | | | | | Merge remote-tracking branch 'upstream/master' into cmn/host-cert-infoCarlos Martín Nieto2014-09-1612-20/+372
| |\ \ \ \ \ \
| * | | | | | | ssh: add test for host keyCarlos Martín Nieto2014-09-161-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that the certificate check callback gets the right fingerprint from the host we're connecting to.
| * | | | | | | winhttp: credential check on successful connectCarlos Martín Nieto2014-09-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
| * | | | | | | Bring certificate check back to the normal return codeCarlos Martín Nieto2014-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning 0 lets the certificate check succeed. An error code is bubbled up to the user.
| * | | | | | | ssh: do ssh cert info before asking for credentialsCarlos Martín Nieto2014-09-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know the host's key as soon as we connect, so we should perform the check as soon as we can, before we bother with the user's credentials.
| * | | | | | | transport: always call the certificate check callbackCarlos Martín Nieto2014-09-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should let the user decide whether to cancel the connection or not regardless of whether our checks have decided that the certificate is fine. We provide our own assessment to the callback to let the user fall back to our checks if they so desire.
| * | | | | | | remote: add tests for the certificate callbackCarlos Martín Nieto2014-09-161-0/+35
| | | | | | | |
| * | | | | | | Provide a callback for certificate validationCarlos Martín Nieto2014-09-161-1/+1
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
* | | | | | | Clean up some leaks in the test suiteCarlos Martín Nieto2014-09-173-0/+4
| | | | | | |
* | | | | | | Merge pull request #2561 from jacquesg/merge-skipVicent Marti2014-09-161-0/+41
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | No files merged may result in bogus merge conflict error
| * | | | | | | Added test case to illustrate bogus conflicts detected if no files were ↵Jacques Germishuys2014-09-121-0/+41
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | merged, and untracked files exist in the workdir.
* | | | | | | Fix attribute lookup in index for bare reposrb/attr-with-bareRussell Belfer2014-09-151-0/+36
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a bare repo with an index, libgit2 attempts to read files from the index. It caches those files based on the path to the file, specifically the path to the directory that contains the file. If there is no working directory, we use `git_path_dirname_r` to get the path to the containing directory. However, for the `.gitattributes` file in the root of the repository, this ends up normalizing the containing path to `"."` instead of the empty string and the lookup the `.gitattributes` data fails. This adds a test of attribute lookups on bare repos and also fixes the problem by simply rewriting `"."` to be `""`.
* | | | | | Merge pull request #2554 from linquize/fetch-head-tagVicent Marti2014-09-152-0/+27
|\ \ \ \ \ \ | |/ / / / / |/| | | | | When auto follow tags, FETCH_HEAD should list only newly followed tags
| * | | | | When auto follow tags, FETCH_HEAD should list only newly followed tagsLinquize2014-09-062-0/+27
| |/ / / /
* | | | | signature: don't allow empty emailscmn/signature-empty-emailCarlos Martín Nieto2014-09-101-2/+2
| |/ / / |/| | | | | | | | | | | | | | | | | | | A signature is made up of a non-empty name and a non-empty email so let's validate that. This also brings us more in line with git, which also rejects ident with an empty email.
* | | | Merge pull request #2511 from libgit2/cmn/remote-default-restrictVicent Marti2014-09-092-0/+108
|\ \ \ \ | | | | | | | | | | Restrict which refs can be the default branch
| * | | | clone: handle overly restrictive refspecscmn/remote-default-restrictCarlos Martín Nieto2014-09-021-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the fetch refspec does not include the remote's default branch, it indicates an error in user expectations or programmer error. Error out in that case. This lets us get rid of the dummy refspec which can never work as its zeroed out. In the cases where we did not find a default branch, we set HEAD detached immediately, which lets us refactor the "normal" path, removing `found_branch`.
| * | | | clone: correct handling of an unborn HEADCarlos Martín Nieto2014-09-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | If the remote does not advertise HEAD, then it is unborn and we cannot checkout that branch. Handle it the same way as an empty repo.
| * | | | remote: add test for single-branch cloneCarlos Martín Nieto2014-09-021-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | When cloning, we may be asking for a particular branch or subset of branches. Make sure we test for that.
| * | | | remote: add tests for remote-branch edge casesCarlos Martín Nieto2014-09-021-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests for the case when there are no branches on the remote and when HEAD is detached but has the id of a non-branch. In both of these cases, we should return ENOTFOUND.
| * | | | remote: assert what we want to happen when ther is no default branchCarlos Martín Nieto2014-08-291-0/+14
| |/ / / | | | | | | | | | | | | Assert what we already do, so as to notice changes.
* | | | Merge pull request #2543 from libgit2/cmn/known-transportsVicent Marti2014-09-031-16/+14
|\ \ \ \ | | | | | | | | | | Clean up transport lookup
| * | | | remote: test for supported URLs in a single placeCarlos Martín Nieto2014-08-311-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of using ifdefs to run the tests, use them to set when we expect to support a particular scheme and always have the tests in the code.
| * | | | remote: get rid of git_remote_valid_url()Carlos Martín Nieto2014-08-311-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It does the same as git_remote_supported_url() but has a name which implies we'd check the URL for correctness while we're simply looking at the scheme and looking it up in our lists. While here, fix up the tests so we check all the combination of what's supported.
* | | | | Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-023-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach git_repository_init_ext to use relative paths for the gitlink to the work directory. This is used when creating a sub repository where the sub repository resides in the parent repository's .git directory.
* | | | | Introduce git_path_make_relativeEdward Thomson2014-09-021-0/+55
| | | | |
* | | | | Merge pull request #2545 from linquize/no-sshVicent Marti2014-09-031-0/+9
|\ \ \ \ \ | |/ / / / |/| | | | Skip SSH clone tests if libgit2 not built with GIT_SSH defined
| * | | | Skip SSH clone tests if libgit2 not built with GIT_SSH definedLinquize2014-09-011-0/+9
| |/ / /
* | | | MSVC does not support zero size arrayLinquize2014-08-311-2/+1
| | | |
* | | | Merge pull request #2481 from libgit2/cmn/oidarrayVicent Marti2014-08-291-0/+18
|\ \ \ \ | |/ / / |/| | | merge: expose multiple merge bases
| * | | merge: expose multiple merge basescmn/oidarrayCarlos Martín Nieto2014-07-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always calculate multiple merge bases, but up to now we had only exposed the "best" merge base. Introduce git_oidarray which analogously to git_strarray lets us return multiple ids.
* | | | Merge pull request #2539 from libgit2/cmn/ahead-behind-orderVicent Marti2014-08-281-18/+18
|\ \ \ \ | | | | | | | | | | Fix ahead-behind results
| * | | | Fix ahead-behind testsCarlos Martín Nieto2014-08-281-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | The logic was reversed. I have checked manually each pair with git and adjusted the expectation to what git status prints.
* | | | | Merge pull request #2538 from libgit2/ntk/propagate_url_parsing_errorVicent Marti2014-08-271-0/+6
|\ \ \ \ \ | | | | | | | | | | | | winhttp: Prevent swallowing of url parsing error
| * | | | | winhttp: Prevent swallowing of url parsing errornulltoken2014-08-271-0/+6
| | | | | |
* | | | | | Merge pull request #2490 from csware/ssh-wintunnelVicent Marti2014-08-271-0/+66
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Allow to override default ssh transport_cb - in order to allow third party ssh transports
| * | | | | Added some testsSven Strickroth2014-08-271-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | | | | Adjust clone tests to USERNAME cred typeCarlos Martín Nieto2014-08-271-0/+3
| | | | | |
* | | | | | Merge remote-tracking branch 'upstream/master' into cmn/ssh-retryCarlos Martín Nieto2014-08-2774-395/+987
|\ \ \ \ \ \
| * \ \ \ \ \ Merge pull request #2508 from libgit2/rb/fix-ignore-slash-starVicent Marti2014-08-261-0/+95
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | Fix bugs with negative ignores inside an ignored parent directory
| | * | | | | Demonstrate a trailing slash failure.rb/fix-ignore-slash-starRob Rix2014-08-081-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git help ignore` has this to say about trailing slashes: > If the pattern ends with a slash, it is removed for the purpose of > the following description, but it would only find a match with a > directory. In other words, foo/ will match a directory foo and > paths underneath it, but will not match a regular file or a > symbolic link foo (this is consistent with the way how pathspec > works in general in Git). Sure enough, having manually performed the same steps as this test, `git status` tells us the following: # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: force.txt # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # ../.gitignore # child1/ # child2/ i.e. neither child1 nor child2 is ignored.
| | * | | | | status: failing test with slash-starCarlos Martín Nieto2014-08-081-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing 'bin/*' in the rules, this means we ignore very file inside bin/ individually, but do not ignore the directory itself. Thus the status listing should list both files under bin/, one untracked and one ignored.
| * | | | | | Merge pull request #2531 from libgit2/rb/mkdir-allow-parent-failuresVicent Marti2014-08-251-0/+31
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Allow mkdir helper to skip parent errors
| | * | | | | | Allow mkdir helper to skip parent errorsrb/mkdir-allow-parent-failuresRussell Belfer2014-08-221-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our mkdir helper was failing is a parent directory was not accessible even if the child directory could be created. This changes the helper to keep trying child directories even when the parent is unwritable.
| * | | | | | | Merge pull request #2527 from jacquesg/refspec-crashVicent Marti2014-08-251-5/+43
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | Check if the refspec matches before transforming
| | * | | | | | Check if the refspec matches before transformingJacques Germishuys2014-08-171-5/+43
| | | |/ / / / | | |/| | | |