Commit Graph

7459 Commits

Author SHA1 Message Date
Carlos Martín Nieto
cf15ac8aa9 ssl: cargo-cult thread safety
OpenSSL's tests init everything in the main thread, so let's do that.
2014-06-12 14:37:03 +02:00
Carlos Martín Nieto
5fa0494328 ssl: use locking
When using in a multithreaded context, OpenSSL needs to lock, and leaves
it up to application to provide said locks.

We were not doing this, and it's just luck that's kept us from crashing
up to now.
2014-06-11 23:19:48 +02:00
Carlos Martín Nieto
76f76162b2 remote: update documentation
Add docs for git_clone_local_t and move the docs for the
git_clone_options to each field.
2014-06-11 21:20:23 +02:00
Carlos Martín Nieto
1d3364ac9d netops: init OpenSSL once under lock
The OpenSSL init functions are not reentrant, which means that running
multiple fetches in parallel can cause us to crash.

Use a mutex to init OpenSSL, and since we're adding this extra checks,
init it only once.
2014-06-11 20:54:42 +02:00
Vicent Marti
3f3d21badd Merge pull request #2417 from libgit2/cmn/revwalk-array-fix
revwalk: more sensible array handling
2014-06-11 18:56:24 +02:00
Carlos Martín Nieto
b42ff7c016 zlib: disable warning 4142 on MSVC
This is about benign redefinition of types. We're not interested in it.
2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
4f8ac2163b zlib: get rid of compress.c and uncompr.c 2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
2bc76050e0 zlib: get rid of gz* 2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
a9185589f9 zlib: add a few missing defines 2014-06-11 18:03:37 +02:00
Carlos Martín Nieto
bb54fad045 Merge branch 'cmn/zlib-update' into cmn/update-zlib 2014-06-11 16:36:34 +02:00
Carlos Martín Nieto
7cead31edd Merge branch 'cmn/zlib-128' into cmn/zlib-update
Conflicts:
	deps/zlib/crc32.c
	deps/zlib/crc32.h
	deps/zlib/zconf.h
2014-06-11 16:36:08 +02:00
Carlos Martín Nieto
4ca2d7e444 Update zlib to 1.2.8 2014-06-11 16:10:00 +02:00
Carlos Martín Nieto
f9a9766794 revwalk: more sensible array handling
Instead of using a sentinel empty value to detect the last commit, let's
check for when we get a NULL from popping the stack, which lets us know
when we're done.

The current code causes us to read uninitialized data, although only on
RHEL/CentOS 6 in release mode. This is a readability win overall.
2014-06-11 00:06:44 +02:00
Carlos Martín Nieto
fcc6006607 treentry: no need for manual size book-keeping
We can simply ask the hasmap.
2014-06-10 15:14:13 +02:00
Carlos Martín Nieto
978fbb4c34 treebuilder: don't keep removed entries around
If the user wants to keep a copy for themselves, they should make a
copy. It adds unnecessary complexity to make sure the returned entries
are valid until the builder is cleared.
2014-06-10 15:14:13 +02:00
Carlos Martín Nieto
4d3f1f9740 treebuilder: use a map instead of vector to store the entries
Finding a filename in a vector means we need to resort it every time we
want to read from it, which includes every time we want to write to it
as well, as we want to find duplicate keys.

A hash-map fits what we want to do much more accurately, as we do not
care about sorting, but just the particular filename.

We still keep removed entries around, as the interface let you assume
they were going to be around until the treebuilder is cleared or freed,
but in this case that involves an append to a vector in the filter case,
which can now fail.

The only time we care about sorting is when we write out the tree, so
let's make that the only time we do any sorting.
2014-06-10 15:14:13 +02:00
Vicent Marti
7064cdafbd Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sorted
treebuilder: insert sorted
2014-06-10 12:56:11 +02:00
Carlos Martín Nieto
17fbf852a5 pathspec: use C guards in header 2014-06-10 03:53:26 +02:00
Carlos Martín Nieto
2c11d2eeb5 treebuilder: insert sorted
By inserting in the right position, we can keep the vector sorted,
making entry insertion almost twice as fast.
2014-06-10 00:06:21 +02:00
Carlos Martín Nieto
281da0043c remote: fix rename docs 2014-06-09 19:35:41 +02:00
Carlos Martín Nieto
47fae920c1 Merge branch 'cmn/soversion' into development 2014-06-08 20:01:45 +02:00
Carlos Martín Nieto
4fb32a44f9 Bump version to 0.21.0
Bump library version to 0.21.0 and SONAME to 21
2014-06-08 20:01:02 +02:00
Carlos Martín Nieto
9980767205 Change SOVERSION at API breaks
Since the SOVERSION doesn't need to follow the library's version and
simply needs to be monotonically increasing whenever we release
something that breaks the ABI, we can set some number and allow multiple
versions of the library to be installed side-by-side.

We start here with the minor version as that's what we release for now,
and it allows to backport this change to earlier versions.
2014-06-08 19:42:54 +02:00
Vicent Marti
ce5e6617b0 Merge pull request #2407 from libgit2/cmn/remote-rename-more
More remote rename fixes
2014-06-08 16:44:32 +02:00
Vicent Marti
9560203d36 Merge pull request #2409 from phkelley/win32_thread_fixes
Win32: Fix object::cache::threadmania test on x64
2014-06-08 16:44:14 +02:00
Philip Kelley
1b4e29b7f6 React to review feedback 2014-06-07 14:40:42 -04:00
Philip Kelley
fb5917679d Win32: Fix object::cache::threadmania test on x64 2014-06-07 12:51:48 -04:00
Philip Kelley
df192198d3 Merge pull request #2408 from phkelley/win32_test_fixes
Win32 test fixes
2014-06-07 12:37:49 -04:00
Philip Kelley
daf2a648b1 Win32: Fix diff::workdir::submodules test #2361 2014-06-07 12:18:56 -04:00
Philip Kelley
6d1b04383e Win32: Fix failing clone_mirror test 2014-06-07 12:18:24 -04:00
Carlos Martín Nieto
231f350d91 remote: don't free the remote on delete
This was a bad idea. Don't free except in the free function.
2014-06-06 22:55:34 +02:00
Carlos Martín Nieto
d154456464 remote: handle symrefs when renaming
A symref inside the namespace gets renamed, we should make it point to
the target's new name.

This is for the origin/HEAD -> origin/master type of situations.
2014-06-06 22:38:26 +02:00
Carlos Martín Nieto
eb6aa791a7 remote: failing test for renaming with a symref 2014-06-06 22:36:41 +02:00
Carlos Martín Nieto
72bca13e5d remote: return problem refspecs instead of using a callback
There is no reason why we need to use a callback here. A string array
fits better with the usage, as this is not an event and we don't need
anything from the user.
2014-06-06 21:43:04 +02:00
Carlos Martín Nieto
61dcfe1400 remote: make sure the name stays valid on rename
We must make sure that the name pointer remains valid, so make sure to
allocate the new one before freeing the old one and swap them so the
user never sees an invalid pointer.
2014-06-06 15:57:37 +02:00
Carlos Martín Nieto
5a49ff9fa0 remote: remove rename code for anonymous remotes
We don't allow renames of anonymous remotes, so there's no need to
handle them.

A remote is always associated with a repository, so there's no need to
check for that.
2014-06-06 15:54:42 +02:00
Vicent Marti
716e20b47e Merge pull request #2404 from libgit2/cmn/remote-rename-fixes
Remote rename fixes
2014-06-06 13:37:22 +02:00
Vicent Marti
c073184e62 Merge pull request #2405 from arthurschreiber/patch-4
Update AUTHORS
2014-06-06 13:35:29 +02:00
Arthur Schreiber
05554d839d Update AUTHORS
Add me. :)
2014-06-06 11:01:20 +02:00
Carlos Martín Nieto
a52ab4b82a remote: tighten up reference renaming
Tighten up which references we consider for renaming so we don't try to
rename unrelated ones and end up with unexplained references.

If there is a reference on the target namespace, git overwrites it, so
let's do the same.
2014-06-06 01:09:49 +02:00
Carlos Martín Nieto
fe3b9d0731 remote: failing test for rename
When there is a reference in the target namespace, we should overwrite
it. Instead it gets a different name under the current code.
2014-06-06 00:54:11 +02:00
Alan Rogers
9e2d2f30de Whitespace wibbles. 2014-06-04 15:41:48 -07:00
Alan Rogers
dc49e1b5b3 Merge remote-tracking branch 'origin/development' into fix-git-status-list-new-unreadable-folder
Conflicts:
	include/git2/diff.h
2014-06-04 15:36:28 -07:00
Alan Rogers
54c02d212d Clear out the struct. 2014-06-04 15:27:00 -07:00
Alan Rogers
a576a34257 Add another test for unreadable and not included. 2014-06-04 14:47:44 -07:00
Carlos Martín Nieto
e58281aaba filebuf: make unlocking atomic
When renaming a lock file to its final location, we need to make sure
that it is replaced atomically.

We currently have a workaround for Windows by removing the target file.
This means that the target file, which may be a ref or a packfile, may
cease to exist for a short wile, which shold be avoided.

Implement the workaround only in Windows, by making sure that the file
we want to replace is writable.
2014-06-04 11:58:18 -07:00
Alan Rogers
5e6542003e Implement GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED 2014-06-04 11:53:44 -07:00
Alan Rogers
7b491a7dea GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED 2014-06-03 17:50:00 -07:00
Alan Rogers
79d5b5c916 Add GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED
and a (failing) test for it.
2014-06-03 17:42:52 -07:00
Vicent Marti
90befde4a1 Merge pull request #2399 from libgit2/cmn/path-to-path
clone: re-use the local transport's path resolution
2014-06-03 22:10:34 +02:00