Carlos Martín Nieto
52e09724fd
ssh: skip the localhost cert check earlier
...
Skip it before we attempt to clone, as we would exit with -1 on systems
which do not have sshd running.
2014-09-16 17:13:58 +02:00
Carlos Martín Nieto
1e0aa105fa
ssh: expose both hashes
...
The user may have the data hashed as MD5 or SHA-1, so we should provide
both types for consumption.
2014-09-16 17:02:33 +02:00
Carlos Martín Nieto
286369a81f
ssh: provide our own types for host key lengths
...
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.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0782fc43f8
net: use only structs to pass information about cert
...
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.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0fef38999a
Merge remote-tracking branch 'upstream/master' into cmn/host-cert-info
2014-09-16 17:02:28 +02:00
Carlos Martín Nieto
bf8756d6a2
ssh: add test for host key
...
Test that the certificate check callback gets the right fingerprint from
the host we're connecting to.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
08545d366b
winhttp: credential check on successful connect
...
On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
23ca0ad5eb
Bring certificate check back to the normal return code
...
Returning 0 lets the certificate check succeed. An error code is bubbled
up to the user.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
2f5864c50c
ssh: do ssh cert info before asking for credentials
...
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.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
17491f6e56
transport: always call the certificate check callback
...
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.
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
85acc56262
remote: add tests for the certificate callback
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
9b9405865e
Provide a callback for certificate validation
...
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.
2014-09-16 17:01:30 +02:00
Vicent Marti
a7fcac13a5
Merge pull request #2554 from linquize/fetch-head-tag
...
When auto follow tags, FETCH_HEAD should list only newly followed tags
2014-09-15 20:26:12 +02:00
Carlos Martín Nieto
76e3c43fb9
signature: don't allow empty emails
...
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.
2014-09-10 18:14:46 +02:00
Vicent Marti
31e752b654
Merge pull request #2511 from libgit2/cmn/remote-default-restrict
...
Restrict which refs can be the default branch
2014-09-09 12:52:36 +02:00
Linquize
d908351a6c
When auto follow tags, FETCH_HEAD should list only newly followed tags
2014-09-06 00:26:56 +08:00
Vicent Marti
89e05e2ab1
Merge pull request #2543 from libgit2/cmn/known-transports
...
Clean up transport lookup
2014-09-03 12:50:44 +02:00
Jameson Miller
bc737620dd
Introduce option to use relative paths for repository work directory
...
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.
2014-09-02 21:07:26 -04:00
Edward Thomson
0ee9f31c3b
Introduce git_path_make_relative
2014-09-02 21:07:23 -04:00
Vicent Marti
0ac9f9a0c7
Merge pull request #2545 from linquize/no-ssh
...
Skip SSH clone tests if libgit2 not built with GIT_SSH defined
2014-09-03 00:13:23 +02:00
Carlos Martín Nieto
15c30b72e1
clone: handle overly restrictive refspecs
...
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`.
2014-09-02 13:23:54 +02:00
Carlos Martín Nieto
e128a1af6e
clone: correct handling of an unborn HEAD
...
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.
2014-09-02 13:10:19 +02:00
Carlos Martín Nieto
538f908175
remote: add test for single-branch clone
...
When cloning, we may be asking for a particular branch or subset of
branches. Make sure we test for that.
2014-09-02 12:47:12 +02:00
Carlos Martín Nieto
f2ffab618a
remote: add tests for remote-branch edge cases
...
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.
2014-09-02 12:47:12 +02:00
Linquize
fe3b67891b
Skip SSH clone tests if libgit2 not built with GIT_SSH defined
2014-09-01 19:18:20 +08:00
Carlos Martín Nieto
05ac70514f
remote: test for supported URLs in a single place
...
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.
2014-08-31 21:53:42 +02:00
Carlos Martín Nieto
ba67c07522
remote: get rid of git_remote_valid_url()
...
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.
2014-08-31 21:50:28 +02:00
Linquize
aff7001825
MSVC does not support zero size array
2014-08-31 22:43:53 +08:00
Vicent Marti
46a13f3247
Merge pull request #2481 from libgit2/cmn/oidarray
...
merge: expose multiple merge bases
2014-08-29 18:19:56 +02:00
Carlos Martín Nieto
94412b009e
remote: assert what we want to happen when ther is no default branch
...
Assert what we already do, so as to notice changes.
2014-08-29 15:28:10 +02:00
Vicent Marti
d99c8ca178
Merge pull request #2539 from libgit2/cmn/ahead-behind-order
...
Fix ahead-behind results
2014-08-28 16:33:53 +02:00
Carlos Martín Nieto
e07aebb4e2
Fix ahead-behind tests
...
The logic was reversed. I have checked manually each pair with git and
adjusted the expectation to what git status prints.
2014-08-28 13:34:42 +02:00
Vicent Marti
69db893427
Merge pull request #2538 from libgit2/ntk/propagate_url_parsing_error
...
winhttp: Prevent swallowing of url parsing error
2014-08-27 19:19:55 +02:00
Vicent Marti
1485c6833a
Merge pull request #2490 from csware/ssh-wintunnel
...
Allow to override default ssh transport_cb - in order to allow third party ssh transports
2014-08-27 18:02:10 +02:00
nulltoken
f0c53d21a4
winhttp: Prevent swallowing of url parsing error
2014-08-27 17:37:29 +02:00
Sven Strickroth
0e5bb61992
Added some tests
...
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-27 17:27:07 +02:00
Carlos Martín Nieto
c13b68442f
Adjust clone tests to USERNAME cred type
2014-08-27 15:25:46 +02:00
Carlos Martín Nieto
6a0d2b43ee
Merge remote-tracking branch 'upstream/master' into cmn/ssh-retry
2014-08-27 15:09:07 +02:00
Vicent Marti
00e9ae5ab4
Merge pull request #2508 from libgit2/rb/fix-ignore-slash-star
...
Fix bugs with negative ignores inside an ignored parent directory
2014-08-26 17:48:20 +02:00
Vicent Marti
5af52c628b
Merge pull request #2531 from libgit2/rb/mkdir-allow-parent-failures
...
Allow mkdir helper to skip parent errors
2014-08-25 21:04:09 +02:00
Vicent Marti
2c1de697e0
Merge pull request #2527 from jacquesg/refspec-crash
...
Check if the refspec matches before transforming
2014-08-25 18:18:06 +02:00
Russell Belfer
668ae2ddf8
Allow mkdir helper to skip parent errors
...
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.
2014-08-22 10:05:09 -07:00
Vicent Marti
d28b2b7a5f
Merge pull request #2528 from libgit2/vmg/tostr_s
...
Export `git_oid_tostr_s` instead of `_allocfmt`
2014-08-18 15:18:59 +02:00
Vicent Marti
43ebca8d7b
Revert "test: Remove symlinks from the source tree"
...
This reverts commit 0dc54e1494
.
2014-08-18 15:18:47 +02:00
Vicent Marti
0dc54e1494
test: Remove symlinks from the source tree
...
We don't really use this at all, and it breaks packaging in Windows.
2014-08-18 12:47:16 +02:00
Vicent Marti
4ca0b566ca
oid: Export git_oid_tostr_s
instead of _allocfmt
...
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.
2014-08-18 12:41:06 +02:00
Jacques Germishuys
4e53c28096
Check if the refspec matches before transforming
2014-08-17 14:55:06 +02:00
Jacques Germishuys
dc8adda4f1
git_remote_ls() should return an error if the transport is not available
2014-08-15 22:56:15 +02:00
Edward Thomson
e003f83a58
Introduce git_buf_decode_base64
...
Decode base64-encoded text into a git_buf
2014-08-15 11:12:42 -04:00
Edward Thomson
adcdeb36b0
online::clone::credentials support default credentials
2014-08-15 11:12:42 -04:00