Commit Graph

10068 Commits

Author SHA1 Message Date
Carlos Martín Nieto
050ea99cc9 fixup 2017-03-13 09:42:23 +01:00
Carlos Martín Nieto
d364f481d0 fixup 2017-03-12 21:44:32 +01:00
Carlos Martín Nieto
d617f1de94 fixup 2017-03-12 21:24:55 +01:00
Carlos Martín Nieto
5a3df6bd83 Revert "ssh: don't forget to look up libssh2_init"
This reverts commit 4b98ce3d3e.
2017-03-12 21:17:37 +01:00
Carlos Martín Nieto
6f2bf5d82a ssh: don't try to look up when linked at compile-time
Instead of trying to use the same functions by looking them up at startup, rely
on the linker to give us the right functions and simply define away the `git_`
prefix.

This should let us work with both compile-time and run-time linking, though it
introduces a lot of conditional compilation.
2017-03-12 21:14:47 +01:00
Carlos Martín Nieto
e488582bf1 ssh: do return an error if we cannot find a required function 2017-03-12 20:55:44 +01:00
Carlos Martín Nieto
4b98ce3d3e ssh: don't forget to look up libssh2_init 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
b0cef2c5ca ssh: add a few more GIT_SSH checks
If we're not actually using libssh2, we must not refer to the handle, as it has
not been defined.
2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
00b886a0a2 appveyor: enable runtime libssh2 loading 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
5158ac7aa5 ssh: explicitly keep track of libssh2 being available
We cannot rely on the handle being `NULL` since `RTLD_DEFAULT` happens to have
the same value on many architectures. Keep a new variable to tell us whether
we think libssh2 has been loaded.
2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
8f1454672d ssh: allow linking against libssh2 as well as detecting at runtime
There is no end to the variation in the way people decide to package their
applications, and there seems to be no larger variety than in the way they
decide to deal with libssh2.

Re-introduce looking for the library at compile time, while adding the
USE_SSH_RUNTIME flag to enable detection at runtime.
2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
2b8507aa5e ssh: error out if we cannot find required functions
We expect all functions to be available from libssh2 library except for loading
a key from memory. Return an error if any of them are not available.
2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
826e020547 ssh: link against "dl"
This is what has `dlopen` and `dlclose`.
2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
a459bd7d15 ssh: adjust meaning of GIT_FEATURE_SSH 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
d716c9ea87 CHANGELOG: add a note about dynamically loading libssh2 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
c81f99cf27 ssh: handle libssh2 DLL path for mingw 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
ff9d49fea2 ssh: use LoadLibrary with mingw 2017-03-12 15:16:30 +01:00
Carlos Martín Nieto
735cf2f2cc appveyor: download a libssh2 DLL to run SSH during the tests 2017-03-12 15:16:29 +01:00
Carlos Martín Nieto
991daf9d17 ssh: add cast to make MSVC happy
The `LoadLibrary` function returns a `FARPROC` which MSVC won't convert on its
own to our function signatures. Add a void pointer cast to silence that warning.
2017-03-12 15:16:29 +01:00
Carlos Martín Nieto
48412b4777 ssh: go with SOVERSION 1 directly
Using specific version numbers won't work out well, use the simple SOVERSION
from the shared object.
2017-03-12 15:16:29 +01:00
Carlos Martín Nieto
b80a1f563f ssh: declare the function variables manually
While we can use the `typeof` extension with GCC and Clang, this is not
available on MSVC and its equivalent `decltype` is only available for C++.

As we must do this for MSVC, let's do it for all implementations.
2017-03-12 15:16:29 +01:00
Carlos Martín Nieto
9cc10d48a9 ssh: don't try to link against libssh2
Part of the point of this is being able to load libssh2 regardless of whether
it was available upon building, as the resulting shared object might move.

Make USE_SSH mean to try to load it at runtime. We still need to know the
signatures of the functions for our macros to work, so include a copy of the
header as a vendored dependency.
2017-03-12 15:16:29 +01:00
Etienne Samson
9c7b952055 Maybe WIN32 ? 2017-03-12 15:16:29 +01:00
Etienne Samson
64314b7a33 Wrong & misplaced #ifdef guards 2017-03-12 15:16:29 +01:00
Etienne Samson
31d8b65038 Missing #ifdef around memory credentials 2017-03-12 15:16:29 +01:00
Etienne Samson
f47b7896dd Wrap calls to libssh2 in our namespace and dlsym everything in init 2017-03-12 15:16:29 +01:00
Etienne Samson
559f8d57ac Weak-link against libssh2 and load it at runtime 2017-03-12 15:16:29 +01:00
Carlos Martín Nieto
53454be87f Merge pull request #4157 from adamniedzielski/4099-git-sort-time-uninteresting
Skip uninteresting commits in revwalk timesort iterator
2017-03-11 19:52:05 +01:00
Carlos Martín Nieto
0b3623ac47 Merge pull request #4156 from libgit2/ethomson/readbuffer_dont_hash
git_futils_readbuffer: don't compute sha-1
2017-03-11 19:09:27 +01:00
Edward Thomson
ffd4df6bf2 Merge pull request #4151 from novalis/dturner/rebase-submodule-untracked
rebase: ignore untracked files in submodules
2017-03-09 16:32:38 +00:00
Adam Niedzielski
c11c08a552 Skip uninteresting commits in revwalk timesort iterator
Fixes #4099
2017-03-09 14:01:10 +01:00
Edward Thomson
11c8e756ac git_futils_readbuffer: don't compute sha-1
Don't compute the sha-1 in `git_futils_readbuffer_updated` unless the
checksum was requested.  This means that `git_futils_readbuffer` will
not calculate the checksum unnecessarily.
2017-03-09 12:26:23 +00:00
Edward Thomson
b31b236004 Merge pull request #4154 from libgit2/ethomson/namespaces
Support namespaced references again
2017-03-06 15:53:57 +00:00
Edward Thomson
835805625a refdb_fs: honor the namespace 2017-03-06 14:20:12 +00:00
Edward Thomson
d24ae06d72 refs::namespace: add namespace tests
These simple tests only ensure that we enforce the existence of a
namespace; these mirror the rugged tests, they are not exhaustive.
2017-03-06 14:11:00 +00:00
David Turner
2270ca9f8f rebase: ignore untracked files in submodules
An untracked file in a submodule should not prevent a rebase from
starting.  Even if the submodule's SHA is changed, and that file would
conflict with a new tracked file, it's still OK to start the rebase
and discover the conflict later.

Signed-off-by: David Turner <dturner@twosigma.com>
2017-03-03 15:07:54 -05:00
Carlos Martín Nieto
467185ff13 Merge pull request #4150 from libgit2/ethomson/freshen_trees
git_commit_create: freshen tree objects in commit
2017-03-03 16:12:12 +01:00
Edward Thomson
52d03f37f7 git_commit_create: freshen tree objects in commit
Freshen the tree object that a commit points to during commit time.
2017-03-03 14:12:00 +00:00
Carlos Martín Nieto
3348570a0c Merge pull request #4136 from libgit2/ethomson/sha1dc
Introduce (optional) SHA1 collision attack detection
2017-03-03 12:36:36 +01:00
Edward Thomson
9f128d2a77 cmake: drop unset SHA1_TYPE
We never set `SHA1_TYPE` to `builtin`.  Don't bother testing for it.
2017-03-03 10:50:28 +00:00
Edward Thomson
d087c8f80e hash: test for sha1 collision attack detection 2017-03-03 10:50:28 +00:00
Edward Thomson
2dfd1294f7 hash: include sha1collisiondetection
Include the SHA1 collision attack detection library from
https://github.com/cr-marcstevens/sha1collisiondetection
2017-03-03 10:50:27 +00:00
Edward Thomson
a371a8ae94 hash: rename implementation selection constants 2017-03-03 10:50:27 +00:00
Patrick Steinhardt
ba2bc4911d Merge pull request #4148 from pks-t/pks/fix-haiku-builds
cmake: only enable supported compiler warning flags
2017-03-01 14:51:39 +01:00
Patrick Steinhardt
a02e8a3882 cmake: only enable supported compiler warning flags
We currently unconditionally enable the "-Wall" and "-Wextra" flags.
Some platforms rely on compilers which do not support these flags,
though. One of these platforms is Haiku, which does not support
"-Wextra" due to being stuck on GCC version 2.

Fix builds on such platforms by adding these flags only if supported by
the compiler.
2017-03-01 13:58:15 +01:00
Patrick Steinhardt
a454641ee8 Merge pull request #4145 from pks-t/pks/refs-create-memleak
tests: refs::create: fix memory leak
2017-03-01 08:45:48 +01:00
Patrick Steinhardt
5aa1f12a81 tests: refs::create: fix memory leak 2017-03-01 07:45:14 +01:00
Patrick Steinhardt
cf8e9a3ad5 Merge pull request #4143 from richardipsum/issue-4094
Fix: make reflog include "(merge)" for merge commits
2017-03-01 07:35:44 +01:00
Richard Ipsum
397cf1a1f5 Add test for inclusion of (merge) in reflog
This test ensures that the string '(merge)' is included in the reflog
when a merge commit is made.
2017-02-28 22:32:21 +00:00
Richard Ipsum
1255a9ac0c Fix: make reflog include "(merge)" for merge commits
This fixes issue #4094
2017-02-27 23:53:12 +00:00