summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* commit: add function to attach a signature to a commitcmn/commit-with-signatureCarlos Martín Nieto2016-03-151-0/+64
| | | | | In combination with the function which creates a commit into a buffer, this allows us to more easily create signed commits.
* Merge pull request #3670 from libgit2/vmg/expand-fixesEdward Thomson2016-03-091-70/+154
|\ | | | | Fixes for `gid_odb_expand_ids`
| * odb: Try to lookup headers in all backends before passthroughvmg/expand-fixesVicent Marti2016-03-091-5/+20
| |
| * odb: Refactor `git_odb_expand_ids`Vicent Marti2016-03-091-21/+26
| |
| * odb: Implement new helper to read types without refreshingVicent Marti2016-03-091-45/+104
| |
| * odb: Handle corner cases in `git_odb_expand_ids`Vicent Marti2016-03-091-22/+27
| | | | | | | | | | | | | | | | | | | | The old implementation had two issues: 1. OIDs that were too short as to be ambiguous were not being handled properly. 2. If the last OID to expand in the array was missing from the ODB, we would leak a `GIT_ENOTFOUND` error code from the function.
* | mwindow: free unused windows if we fail to mmapcmn/mwindow-try-harderCarlos Martín Nieto2016-03-091-2/+12
|/ | | | | | The first time may be due to memory fragmentation or just bad luck on a 32-bit system. When we hit the mmap error for the first time, free up the unused windows and try again.
* Merge pull request #3656 from ethomson/exists_prefixesVicent Marti2016-03-086-36/+104
|\ | | | | Introduce `git_odb_expand_ids`
| * git_odb_expand_ids: accept git_odb_expand_id arrayEdward Thomson2016-03-081-32/+19
| | | | | | | | Take (and write to) an array of a struct, `git_odb_expand_id`.
| * git_odb_expand_ids: rename func, return the typeEdward Thomson2016-03-081-5/+11
| |
| * git_odb_exists_many_prefixes: query odb for multiple short idsEdward Thomson2016-03-072-12/+77
| | | | | | | | | | Query the object database for multiple objects at a time, given their object ID (which may be abbreviated) and optional type.
| * odb: improved not found error messagesEdward Thomson2016-03-075-24/+34
| | | | | | | | | | When looking up an abbreviated oid, show the actual (abbreviated) oid the caller passed instead of a full (but ambiguously truncated) oid.
* | Merge pull request #3555 from cbargren/ssh-git-protocolsEdward Thomson2016-03-082-17/+34
|\ \ | | | | | | Support for ssh+git and git+ssh protocols
| * | TabsChris Bargren2015-12-281-2/+2
| | |
| * | Removing #define for SSH_PREFIX_COUNT and using ARRAY_SIZE insteadChris Bargren2015-12-281-6/+5
| | | | | | | | | Also moving var declarations to top of blocks to support bad old compilers
| * | Handle git+ssh:// and ssh+git:// protocols supportChris Bargren2015-12-222-17/+35
| | |
* | | commit: split creating the commit and writing it outcmn/commit-to-memoryCarlos Martín Nieto2016-03-081-47/+128
| |/ |/| | | | | | | | | Sometimes you want to create a commit but not write it out to the objectdb immediately. For these cases, provide a new function to retrieve the buffer instead of having to go through the db.
* | treebuilder: don't try to verify submodules exist in the odbcmn/treebuilder-submoduleCarlos Martín Nieto2016-03-041-1/+2
| | | | | | | | | | | | | | | | Submodules don't exist in the objectdb and the code is making us try to look for a blob with its commit id, which is obviously not going to work. Skip the test if the user wants to insert a submodule.
* | ssh: initialize libssh2cmn/init-libssh2Carlos Martín Nieto2016-03-033-1/+31
| | | | | | | | | | | | | | We should have been doing this, but it initializes itself upon first use, which works as long as nobody's doing concurrent network operations. Initialize it on our init to make sure it's not getting initialized concurrently.
* | Merge pull request #3648 from libgit2/cmn/auth-retryCarlos Martín Nieto2016-03-031-2/+3
|\ \ | | | | | | test: make sure we retry the auth callback on all platforms
| * | winhttp: retry authenticationCarlos Martín Nieto2016-03-031-2/+3
| | | | | | | | | | | | | | | | | | If the caller has provided bad authentication, give them another apportunity to get it right until they give up. This brings WinHTTP in line with the other transports.
* | | Merge pull request #3646 from pks-t/pks/xdiff-fix-from-upstreamCarlos Martín Nieto2016-03-031-2/+5
|\ \ \ | |/ / |/| | xdiff: fix memleak on error case
| * | xdiff: fix memleak on error casePatrick Steinhardt2016-03-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3d1abc5afce fixes a memory leak in the xdiff code. In the process of upstreaming the fix it was pointed out by Johannes Schindelin that there is another memory leak present (see [1]). Fix the second memory leak by applying the upstream fix to our code base. [1]: http://thread.gmane.org/gmane.comp.version-control.git/287034
* | | Merge pull request #3633 from ethomson/safe_creationEdward Thomson2016-03-017-24/+128
|\ \ \ | |/ / |/| | Stricter object dependency checking during creation
| * | turn on strict object validation by defaultEdward Thomson2016-02-281-1/+1
| | |
| * | refs: honor strict object creationEdward Thomson2016-02-281-7/+1
| | |
| * | git_object__is_valid: use `odb_read_header`Edward Thomson2016-02-282-15/+28
| | | | | | | | | | | | | | | This allows lighter weight validation in `git_object__is_valid` that does not require reading the entire object.
| * | git_index_add: validate objects in index entries (optionally)Edward Thomson2016-02-282-6/+36
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the index entries given to `git_index_add`.
| * | treebuilder: validate tree entries (optionally)Edward Thomson2016-02-281-0/+15
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to treebuilder insertion.
| * | git_commit: validate tree and parent idsEdward Thomson2016-02-281-11/+37
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to commit creation functions.
| * | git_object__is_valid: simple object validity testEdward Thomson2016-02-281-0/+16
| | |
| * | git_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`Edward Thomson2016-02-283-0/+10
| | |
* | | Merge pull request #3567 from sba1/few-p_getaddrinfo-fixesEdward Thomson2016-02-281-2/+5
|\ \ \ | |/ / |/| | Few p_getaddrinfo fixes
| * | Copy into the correct destination.Sebastian Bauer2015-12-311-1/+1
| | |
| * | Bail out early when no memory is available.Sebastian Bauer2015-12-311-1/+4
| | |
* | | Merge pull request #3577 from rossdylan/rossdylan/pooldebugEdward Thomson2016-02-282-30/+106
|\ \ \ | | | | | | | | Add a new build flag to disable the pool allocator
| * | | Fixed typo in one of the ifndef's in pool.h used to enable/disable debug modeRoss Delinger2016-02-261-1/+1
| | | |
| * | | Remove unnecessary ifdef in pool.hRoss Delinger2016-02-191-3/+0
| | | |
| * | | Add a new build flag to disable the pool allocator and pass all ↵Ross Delinger2016-01-122-30/+109
| |/ / | | | | | | | | | git_pool_malloc calls straight to git__malloc
* | | Merge pull request #3638 from ethomson/nsecCarlos Martín Nieto2016-02-254-11/+25
|\ \ \ | | | | | | | | USE_NSECS fixes
| * | | nsec: support NDK's crazy nanosecondsEdward Thomson2016-02-254-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android NDK does not have a `struct timespec` in its `struct stat` for nanosecond support, instead it has a single nanosecond member inside the struct stat itself. We will use that and use a macro to expand to the `st_mtim` / `st_mtimespec` definition on other systems (much like the existing `st_mtime` backcompat definition).
* | | | Merge pull request #3628 from pks-t/pks/coverity-fixesEdward Thomson2016-02-2515-61/+99
|\ \ \ \ | | | | | | | | | | Coverity fixes
| * | | | diff_tform: fix potential NULL pointer accessPatrick Steinhardt2016-02-231-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `normalize_find_opts` function in theory allows for the incoming diff to have no repository. When the caller does not pass in diff find options or if the GIT_DIFF_FIND_BY_CONFIG value is set, though, we try to derive the configuration from the diff's repository configuration without first verifying that the repository is actually set to a non-NULL value. Fix this issue by explicitly checking if the repository is set and if it is not, fall back to a default value of GIT_DIFF_FIND_RENAMES.
| * | | | xmerge: fix memory leak on error pathPatrick Steinhardt2016-02-231-0/+2
| | | | |
| * | | | openssl_stream: fix NULL pointer dereferencePatrick Steinhardt2016-02-231-0/+2
| | | | |
| * | | | openssl_stream: fix memory leak when creating new streamPatrick Steinhardt2016-02-231-2/+10
| | | | |
| * | | | rebase: plug memory leak in `rebase_alloc`Patrick Steinhardt2016-02-231-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert `rebase_alloc` to use our usual error propagation patterns, that is accept an out-parameter and return an error code that is to be checked by the caller. This allows us to use the GITERR_CHECK_ALLOC macro, which helps static analysis.
| * | | | remote: set error code in `create_internal`Patrick Steinhardt2016-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the error code when an error occurs in any of the called functions. This ensures we pass the error up to callers and actually free the remote when an error occurs.
| * | | | index: fix contradicting comparisonPatrick Steinhardt2016-02-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overflow check in `read_reuc` tries to verify if the `git__strtol32` parses an integer bigger than UINT_MAX. The `tmp` variable is casted to an unsigned int for this and then checked for being greater than UINT_MAX, which obviously can never be true. Fix this by instead fixing the `mode` field's size in `struct git_index_reuc_entry` to `uint32_t`. We can now parse the int with `git__strtol64`, which can never return a value bigger than `UINT32_MAX`, and additionally checking if the returned value is smaller than zero. We do not need to handle overflows explicitly here, as `git__strtol64` returns an error when the returned value would overflow.
| * | | | index: plug memory leak in `read_conflict_names`Patrick Steinhardt2016-02-231-4/+14
| | | | |