summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* array: mark the array to grow as volatilereplace-luagit2Carlos Martín Nieto2014-08-051-1/+1
| | | | | | This works around strict aliasing rules letting some versions of GCC (particularly on RHEL 6) thinking that they can skip updating the size of the array when calculating the next element's offset.
* revwalk: remove preallocation of the uninteresting commitsCarlos Martín Nieto2014-08-051-3/+0
| | | | | | | | | | Preallocating two commits doesn't make much sense as leaving allocation to the first array usage will allocate a sensible size with room for growth. This preallocation has also been hiding issues with strict aliasing in the tests, as we have fairly simple histories and never trigger the growth.
* Add unit test to test add section without lf at EOFLinquize2014-08-051-0/+16
|
* Make sure \n is at the end of config file before a new section is writtenLinquize2014-08-051-3/+3
|
* Properly report failure when expanding a packfileWilliam Swanson2014-08-051-1/+1
|
* refspec: support asterisks in the middle of a patternCarlos Martín Nieto2014-08-052-18/+55
| | | | | | | | | | We used to assume a refspec would only have an asterisk in the middle of their respective pattern. This has not been a valid assumption for some time now with git. Instead of assuming where the asterisk is going to be, change the logic to treat each pattern as having two halves with a replacement bit in the middle, where the asterisk is.
* refspec: short-circuit non-pattern refspecs on transformCarlos Martín Nieto2014-08-051-0/+10
| | | | | | When transforming a non-pattern refspec, we simply need to copy over the opposite string. Move that logic up to the wrapper so we can assume a pattern refspec in the transformation function.
* Include libssh2.h before git2.h (transport.h)Jacques Germishuys2014-08-051-2/+4
|
* Fix git_cred_ssh_interactive_callback signatureJacques Germishuys2014-08-051-1/+1
|
* netops: error out on url without a pathCarlos Martín Nieto2014-08-052-0/+21
| | | | | | In order to connect to a remote server, we need to provide a path to the repository we're interested in. Consider the lack of path in the url an error.
* ssh: libssh2_channel_write() behaves like send()Carlos Martín Nieto2014-08-051-1/+12
| | | | | | | | | | When the stream writing function was written, it assume that libssh2_channel_write() would always write all of the data to the wire. This is only true for the first 32k of data, which it tries to fit into one ssh packet. Since it can perform short writes, call it in a loop like we do for send(), advancing the buffer offset.
* Round up pool alloc sizes for alignmentRussell Belfer2014-08-052-6/+6
| | | | | | | | | | | | | 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.
* ssh: always declare the libssh2 typesCarlos Martín Nieto2014-08-052-19/+11
| | | | | This lets a user decide they do want to use keyboard-interactive after they've compiled.
* ssh: create the right callback signature based on build optionsCarlos Martín Nieto2014-08-052-10/+20
| | | | | | | | | | | 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.
* ssl: init only once without threadsCarlos Martín Nieto2014-08-051-1/+7
| | | | | | | | 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.
* Merge pull request #2494 from libgit2/cmn/treebuilder-set-attributeVicent Marti2014-08-012-3/+67
|\ | | | | treebuilder: set the attributes before sorting and inserting
| * treebuilder: set the attributes before sorting and insertingCarlos Martín Nieto2014-07-312-3/+67
|/ | | | | | We need to set the attributes before we try to insert it into the vector, as the comparison function needs to know whether the entry is a tree or not.
* libgit2 v0.21.0Vicent Marti2014-06-20784-10716/+31834
|\
| * Merge pull request #2425 from libgit2/cmn/clone-auth-changeVicent Marti2014-06-161-9/+3
| |\ | | | | | | Don't use read-write accounts for the tests
| | * test: remove assembla clone testCarlos Martín Nieto2014-06-131-6/+0
| | | | | | | | | | | | | | | | | | | | | The assembla failure we were seeing referred to a private repository, which is not what is there at the moment. This reverts 1fd21b0342f
| | * test: use read-only accountCarlos Martín Nieto2014-06-131-3/+3
| | | | | | | | | | | | | | | | | | 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.
| * | Merge pull request #2421 from libgit2/cmn/init-ssl-onceVicent Marti2014-06-144-16/+81
| |\ \ | | |/ | |/| netops: init OpenSSL once under lock
| | * ssl: init everything all the timeCarlos Martín Nieto2014-06-123-87/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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).
| | * ssl: init also without threadsCarlos Martín Nieto2014-06-121-9/+10
| | |
| | * ssl: cargo-cult thread safetyCarlos Martín Nieto2014-06-124-23/+46
| | | | | | | | | | | | OpenSSL's tests init everything in the main thread, so let's do that.
| | * ssl: use lockingCarlos Martín Nieto2014-06-111-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * netops: init OpenSSL once under lockCarlos Martín Nieto2014-06-113-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | http: fix typo in credentials logicCarlos Martín Nieto2014-06-131-1/+1
| | | | | | | | | | | | | | | We want to check whether the credentials callback is NULL, not whether the payload is.
| * | remote: update documentationCarlos Martín Nieto2014-06-111-18/+60
| | | | | | | | | | | | | | | Add docs for git_clone_local_t and move the docs for the git_clone_options to each field.
| * | Merge pull request #2417 from libgit2/cmn/revwalk-array-fixVicent Marti2014-06-111-2/+2
| |\ \ | | | | | | | | revwalk: more sensible array handling
| | * | revwalk: more sensible array handlingCarlos Martín Nieto2014-06-111-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sortedVicent Marti2014-06-101-2/+2
| |\ \ | | | | | | | | treebuilder: insert sorted
| | * | treebuilder: insert sortedCarlos Martín Nieto2014-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | By inserting in the right position, we can keep the vector sorted, making entry insertion almost twice as fast.
| * | | pathspec: use C guards in headerCarlos Martín Nieto2014-06-101-0/+3
| |/ /
| * | remote: fix rename docsCarlos Martín Nieto2014-06-091-3/+0
| | |
| * | Merge branch 'cmn/soversion' into developmentCarlos Martín Nieto2014-06-082-3/+8
| |\ \
| | * | Bump version to 0.21.0Carlos Martín Nieto2014-06-081-3/+3
| | | | | | | | | | | | | | | | Bump library version to 0.21.0 and SONAME to 21
| | * | Change SOVERSION at API breaksCarlos Martín Nieto2014-06-082-1/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Merge pull request #2407 from libgit2/cmn/remote-rename-moreVicent Marti2014-06-085-115/+191
| |\ \ | | | | | | | | More remote rename fixes
| | * | remote: don't free the remote on deleteCarlos Martín Nieto2014-06-063-5/+1
| | | | | | | | | | | | | | | | This was a bad idea. Don't free except in the free function.
| | * | remote: handle symrefs when renamingCarlos Martín Nieto2014-06-061-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | remote: failing test for renaming with a symrefCarlos Martín Nieto2014-06-061-0/+48
| | | |
| | * | remote: return problem refspecs instead of using a callbackCarlos Martín Nieto2014-06-064-56/+87
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | remote: make sure the name stays valid on renameCarlos Martín Nieto2014-06-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | remote: remove rename code for anonymous remotesCarlos Martín Nieto2014-06-061-42/+11
| | |/ | | | | | | | | | | | | | | | | | | | | | 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.
| * | Merge pull request #2409 from phkelley/win32_thread_fixesVicent Marti2014-06-088-71/+107
| |\ \ | | | | | | | | Win32: Fix object::cache::threadmania test on x64
| | * | React to review feedbackPhilip Kelley2014-06-073-18/+26
| | | |
| | * | Win32: Fix object::cache::threadmania test on x64Philip Kelley2014-06-078-68/+96
| |/ /
| * | Merge pull request #2408 from phkelley/win32_test_fixesPhilip Kelley2014-06-072-2/+5
| |\ \ | | |/ | |/| Win32 test fixes
| | * Win32: Fix diff::workdir::submodules test #2361Philip Kelley2014-06-071-2/+2
| | |