summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* global: free the error message when exiting a threadcmn/free-tls-errorCarlos Martín Nieto2014-09-141-0/+14
| | | | | When we free the global state at thread termination, we must also free the error message in order not to leak the string once per thread.
* 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
| | | |/ / | | |/| |
| * | | | Merge pull request #2528 from libgit2/vmg/tostr_sVicent Marti2014-08-183-14/+5
| |\ \ \ \ | | | | | | | | | | | | Export `git_oid_tostr_s` instead of `_allocfmt`
| | * | | | oid: Export `git_oid_tostr_s` instead of `_allocfmt`vmg/tostr_sVicent Marti2014-08-183-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old `allocfmt` is of no use to callers, as they are not able to free the returned buffer. Export a new API that returns a static string that doesn't need to be freed.
| * | | | | Revert "test: Remove symlinks from the source tree"Vicent Marti2014-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0dc54e149498bbd5de5e5ecc6006f9f5afb6588c.
| * | | | | test: Remove symlinks from the source treeVicent Marti2014-08-181-1/+0
| | |/ / / | |/| | | | | | | | | | | | | We don't really use this at all, and it breaks packaging in Windows.
| * | | | git_remote_ls() should return an error if the transport is not availableJacques Germishuys2014-08-151-0/+11
| | | | |
| * | | | Introduce git_buf_decode_base64Edward Thomson2014-08-151-8/+29
| | | | | | | | | | | | | | | | | | | | Decode base64-encoded text into a git_buf
| * | | | online::clone::credentials support default credentialsEdward Thomson2014-08-151-3/+26
| | | | |
| * | | | Free references during push validationEdward Thomson2014-08-151-0/+2
| | | | |
| * | | | Remove the refs/notes/commits that we push in testEdward Thomson2014-08-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The online::push::notes test pushes a note but leaves it hanging around for other tests to stumble across when they're validating that they're seeing the refs they expect to see. Clean it up on exit.
| * | | | Don't run the ssh clone tests against http remotesEdward Thomson2014-08-141-1/+1
| | | | |
| * | | | Merge pull request #2469 from ethomson/transport2Vicent Marti2014-08-142-0/+2
| |\ \ \ \ | | | | | | | | | | | | Custom transport: minor cleanups
| | * | | | Custom transport: minor cleanupsEdward Thomson2014-08-142-0/+2
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move the transport registration mechanisms into a new header under 'sys/' because this is advanced stuff. * Remove the 'priority' argument from the registration as it adds unnecessary complexity. (Since transports cannot decline to operate, only the highest priority transport is ever executed.) Users who require per-priority transports can implement that in their custom transport themselves. * Simplify registration further by taking a scheme (eg "http") instead of a prefix (eg "http://").
| * | | | Don't include the unreadable tests on win32Edward Thomson2014-08-131-0/+4
| |/ / /
| * | | config: a multiline var can start immediatelyCarlos Martín Nieto2014-08-091-0/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the check for multiline, we traverse the backslashes from the end backwards and int the end assert that we haven't gone past the beginning of the line. We make sure of this in the loop condition, but we also check in the return value. However, for certain configurations, a line in a multiline variable might be empty to aid formatting. In that case, 'end' == 'start', since we ended up looking at the first char which made it a multiline. There is no need for the (end > start) check in the return, since the loop guarantees we won't go further back than the first char in the line, and we do accept the first char to be the final backslash. This fixes #2483.
| * | Don't report status on named pipesRussell Belfer2014-08-081-0/+32
| | | | | | | | | | | | | | | Git skips entries in directories that are not S_ISDIR, S_ISREG, or S_ISLNK, so let's make libgit2 do the same thing.
| * | Merge pull request #2471 from jacquesg/compatibility-cleanupVicent Marti2014-08-074-12/+13
| |\ \ | | | | | | | | Compatibility/Portability cleanup
| | * | Use p_snprintf also in testsJacques Germishuys2014-08-054-12/+13
| | | |
| * | | Merge pull request #2484 from libgit2/fix-git-status-list-new-unreadable-folderVicent Marti2014-07-232-0/+102
| |\ \ \ | | | | | | | | | | Fix git status list new unreadable folder