Commit Graph

7459 Commits

Author SHA1 Message Date
Russell Belfer
5fa8cda981 Round up pool alloc sizes for alignment
To make sure that items returned from pool allocations are aligned
on nice boundaries, this rounds up all pool allocation sizes to a
multiple of 8.  This adds a small amount of overhead to each item.

The rounding up could be made optional with an extra parameter to
the pool initialization that turned on rounding only for pools
where item alignment actually matters, but I think for the extra
code and complexity that would be involved, that it makes sense
just to burn a little bit of extra memory and enable this all the
time.
2014-06-30 12:05:25 -07:00
Vicent Marti
dcdb8500e3 Merge pull request #2440 from phkelley/transports
Improvements to git_transport extensibility
2014-06-30 17:35:42 +02:00
Carlos Martín Nieto
eac63e6754 ssh: create the right callback signature based on build options
When linking against libssh2, create the transport.h such that it
contains its definition for custom crypto and keyboard-interactive
callbacks.

If we don't link against libssh2, create an equivalent signature which
has void pointers instead of pointers to libssh2 structures.

This would be one way to fix #2438.
2014-06-30 10:03:36 +02:00
Carlos Martín Nieto
e6b0ae7a13 ssl: init only once without threads
The OpenSSL library-loading functions do not expect to be called
multiple times. Add a flag in the non-threaded libgit2 init so we only
call once.

This fixes #2446.
2014-06-30 09:29:54 +02:00
Vicent Marti
16e7596d78 Merge pull request #2447 from phkelley/pkt_assert
Fix assert when receiving uncommon sideband packet
2014-06-27 18:11:06 +02:00
Philip Kelley
bc8a088685 Fix assert when receiving uncommon sideband packet 2014-06-27 12:03:27 -04:00
Philip Kelley
1697cd6ff5 Improvements to git_transport extensibility
git_remote_set_transport now takes a transport factory rather than a transport
git_clone_options now allows the caller to specify a remote creation callback
2014-06-26 22:34:37 -04:00
Carlos Martín Nieto
8733993599 travis: enable password authentication on OSX
Our ssh tests assume that the server supports password authentication
in a few places. This is convenient as we're not testing authentication
methods, but what happens around them.

Tell sshd on OSX to accept this form of authentication.
2014-06-26 22:58:39 +02:00
Carlos Martín Nieto
e26b08d32c ssh: adjust clone and push test credentials to the split user+pass method
For urls where we do not specify a username, we must handle the case
where the ssh transport asks us for the username.

Test also that switching username fails.
2014-06-26 22:58:39 +02:00
Carlos Martín Nieto
ccb85c8fa1 ssh: make sure to ask for a username and use the same one
In order to know which authentication methods are supported/allowed by
the ssh server, we need to send a NONE auth request, which needs a
username associated with it.

Most ssh server implementations do not allow switching the username
between authentication attempts, which means we cannot use a dummy
username and then switch. There are two ways around this.

The first is to use a different connection, which an earlier commit
implements, but this increases how long it takes to get set up, and
without knowing the right username, we cannot guarantee that the
list we get in response is the right one.

The second is what's implemented here: if there is no username specified
in the url, ask for it first. We can then ask for the list of auth
methods and use the user's credentials in the same connection.
2014-06-26 22:58:39 +02:00
Carlos Martín Nieto
d1c281a552 cred: add convenience function to get the username
Since each cred defines the username on their own, introduce
git_cred__username to retrieve the username pointer from them.
2014-06-26 22:58:38 +02:00
Carlos Martín Nieto
54da69588e cred: introduce username-only cred
This exists as ssh needs to know about the username to use before it can
query for the supported authentication methods.
2014-06-26 22:58:38 +02:00
Carlos Martín Nieto
d7f962f408 ssh: request credentials again on authentication failure
Instead of completely giving up on the first failure, ask for
credentials as long as we fail to authenticate.
2014-06-26 22:58:38 +02:00
Carlos Martín Nieto
8873728f37 Introduce GIT_EAUTH
Introduce this error code to signal an authentication failure.
2014-06-26 22:58:38 +02:00
Vicent Marti
0145afe635 Merge pull request #2445 from ethomson/checkout_conflict_test
checkout::conflict tests: only test owner mode
2014-06-26 18:24:13 +02:00
Edward Thomson
f4046267dc checkout::conflict tests: only test owner mode
The checkout::conflict type conflict tests were failing because
they were overly assertive about the resultant mode, testing
group & other bits, which failed miserably for people who had a
umask less restrictive than 022.  Only test the resultant owner bits.
2014-06-26 09:16:12 -04:00
Philip Kelley
9c46409d38 Merge pull request #2444 from libgit2/phkelley/flexarray
Fixes #2443 Zero size arrays are an extension
2014-06-26 08:01:01 -04:00
Philip Kelley
f36d57b9bf Fixes #2443 Zero size arrays are an extension 2014-06-26 07:48:09 -04:00
Vicent Marti
86cb34cb11 Merge pull request #2442 from libgit2/cmn/leaks
Fix a couple of leaks
2014-06-25 21:43:52 +02:00
Carlos Martín Nieto
c19b1c0442 pack: clean up error returns
Set a message when we fail to lock.

Also make the put function void, since it's called from free, which
cannot report errors. The only errors we can experience here are
internal state corruption, so we assert that we are trying to put a
pack which we have previously got.
2014-06-25 21:35:58 +02:00
Carlos Martín Nieto
966fb20702 tree: free in error conditions
As reported by coverity, we would leak some memory in error conditions.
2014-06-25 21:25:44 +02:00
Carlos Martín Nieto
5e0f47c375 pack: free the new pack struct if we fail to insert
If we fail to insert the packfile in the map, make sure to free it.

This makes the free function only attempt to remove its mwindows from
the global list if we have opened the packfile to avoid accessing the
list unlocked.
2014-06-25 21:20:39 +02:00
Carlos Martín Nieto
c61dc1a92e travis: build the master branch
We need to tell Travis to build the master branch or it won't build it
or the pull requests.
2014-06-25 17:12:44 +02:00
Vicent Marti
1fe562434d Merge pull request #2435 from ethomson/text_attr
Update text=auto / core.autocrlf=false behavior
2014-06-25 15:14:20 +02:00
Vicent Marti
a252b9e245 Merge pull request #2439 from ethomson/revert_export
Export git_revert_commit
2014-06-25 15:14:14 +02:00
Edward Thomson
4e813a8b60 Export git_revert_commit 2014-06-25 09:11:16 -04:00
Edward Thomson
d412165f94 Update text=auto / core.autocrlf=false behavior
Git for Windows 1.9.4 changed the behavior when the text=auto
attribute is specified and core.autocrlf=false.  Previous observed
behavior would *not* filter files when going into the working
directory, the new behavior *does* filter.  Update our behavior to match.
2014-06-24 13:46:32 -04:00
Carlos Martín Nieto
e1fc03c9ba Add CHANGELOG entry for mixed-EOL fix 2014-06-24 17:56:27 +02:00
Carlos Martín Nieto
3ddd0d929d Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough' 2014-06-24 17:55:15 +02:00
Carlos Martín Nieto
29fe897d80 Add CHANGELOG entry for treebuilder map 2014-06-24 17:52:52 +02:00
Carlos Martín Nieto
5e37874dd4 Merge remote-tracking branch 'upstream/cmn/treebuilder-perf' 2014-06-24 17:51:45 +02:00
Carlos Martín Nieto
130cb54801 Add CHANGELOG entry for shared packs 2014-06-24 17:37:41 +02:00
Carlos Martín Nieto
5815266981 Merge branch 'cmn/global-mwf' 2014-06-24 17:35:14 +02:00
Vicent Marti
35757155f5 Merge pull request #2434 from libgit2/rb/contributing-updates
Update CONTRIBUTING and PROJECTS
2014-06-24 17:30:47 +02:00
Carlos Martín Nieto
5a76ad35aa crlf: pass-through mixed EOL buffers from LF->CRLF
When checking out files, we're performing conversion into the user's
native line endings, but we only want to do it for files which have
consistent line endings. Refuse to perform the conversion for mixed-EOL
files.

The CRLF->LF filter is left as-is, as that conversion is considered to be
normalization by git and should force a conversion of the line endings.
2014-06-23 22:27:12 +02:00
Carlos Martín Nieto
b3b66c5793 Share packs across repository instances
Opening the same repository multiple times will currently open the same
file multiple times, as well as map the same region of the file multiple
times. This is not necessary, as the packfile data is immutable.

Instead of opening and closing packfiles directly, introduce an
indirection and allocate packfiles globally. This does mean locking on
each packfile open, but we already use this lock for the global mwindow
list so it doesn't introduce a new contention point.
2014-06-23 21:50:36 +02:00
Carlos Martín Nieto
d30447cbaf Add a CHANGELOG entry for the filebuf change 2014-06-23 18:02:59 +02:00
Carlos Martín Nieto
461da57aff Merge remote-tracking branch 'upstream/cmn/filebuf-atomic-unlock' 2014-06-23 17:32:30 +02:00
Russell Belfer
b247a39d87 missing paren 2014-06-20 10:15:03 -07:00
Russell Belfer
a142ed91e5 Update CONTRIBUTING and PROJECTS
This updates CONTRIBUTING to reflect the changes to use the
master branch and make explicit recommendations about updating
CHANGELOG.md and providing test coverage.  Also, this includes
some old updates to PROJECTS.md that I wrote to expand the list
of projects, pulling in things from old feature requests.
2014-06-20 10:10:38 -07:00
Vicent Marti
28f087c864 libgit2 v0.21.0 2014-06-20 14:42:16 +02:00
Carlos Martín Nieto
b529c5f96d ssh: propagate the error code from the auth callback
We need to be able to get a GIT_EUSER back through the outermost call.
2014-06-17 10:51:17 +02:00
Carlos Martín Nieto
22618906a5 ssh: detect authentication methods
Before calling the credentials callback, ask the sever which
authentication methods it supports and report that to the user, instead
of simply reporting everything that the transport supports.

In case of an error, we do fall back to listing all of them.
2014-06-17 10:51:17 +02:00
Vicent Marti
1589aa0c4d Merge pull request #2425 from libgit2/cmn/clone-auth-change
Don't use read-write accounts for the tests
2014-06-16 11:11:40 +02:00
Vicent Marti
e93206e0f5 Merge pull request #2421 from libgit2/cmn/init-ssl-once
netops: init OpenSSL once under lock
2014-06-14 12:58:03 +02:00
Carlos Martín Nieto
09561d33e4 test: remove assembla clone test
The assembla failure we were seeing referred to a private repository,
which is not what is there at the moment.

This reverts 1fd21b0342
2014-06-13 22:27:46 +02:00
Carlos Martín Nieto
3382d8b14f test: use read-only account
Don't write in plaintext the password of an account which has full
control over the repository. Instead use an account with read-only
access.
2014-06-13 22:24:43 +02:00
Carlos Martín Nieto
9c3e4e97f6 http: fix typo in credentials logic
We want to check whether the credentials callback is NULL, not whether
the payload is.
2014-06-13 02:35:33 +02:00
Carlos Martín Nieto
081e76bac2 ssl: init everything all the time
Bring together all of the OpenSSL initialization to
git_threads_init() so it's together and doesn't need locks.

Moving it here also gives us libssh2 thread safety (when built against
openssl).
2014-06-12 16:58:25 +02:00
Carlos Martín Nieto
8f897b6f2f ssl: init also without threads 2014-06-12 14:50:08 +02:00