]> git.proxmox.com Git - libgit2.git/log
libgit2.git
8 years agoMerge pull request #3690 from libgit2/cmn/pool-limit
Edward Thomson [Wed, 16 Mar 2016 21:12:14 +0000 (14:12 -0700)]
Merge pull request #3690 from libgit2/cmn/pool-limit

win32: choose the page size as our value for the page size

8 years agoSplit the page size from the mmap alignment
Carlos Martín Nieto [Wed, 16 Mar 2016 18:05:11 +0000 (19:05 +0100)]
Split the page size from the mmap alignment

While often similar, these are not the same on Windows. We want to use the page
size on Windows for the pools, but for mmap we need to use the allocation
granularity as the alignment.

On the other platforms these values remain the same.

8 years agoMerge pull request #3677 from pks-t/pks/coverity-fixes-round7
Carlos Martín Nieto [Mon, 14 Mar 2016 18:15:20 +0000 (19:15 +0100)]
Merge pull request #3677 from pks-t/pks/coverity-fixes-round7

Coverity fixes round 7

8 years agoMerge pull request #3647 from pks-t/pks/coverity-fixes-round6
Carlos Martín Nieto [Mon, 14 Mar 2016 16:45:15 +0000 (17:45 +0100)]
Merge pull request #3647 from pks-t/pks/coverity-fixes-round6

Coverity fixes round 6

8 years agoMerge pull request #3671 from libgit2/cmn/remove-mingw32
Edward Thomson [Mon, 14 Mar 2016 15:00:59 +0000 (15:00 +0000)]
Merge pull request #3671 from libgit2/cmn/remove-mingw32

Remove CI support for mingw32

8 years agoMerge pull request #3683 from dbussink/dbussink/better-openssl-ciphers
Carlos Martín Nieto [Mon, 14 Mar 2016 14:29:30 +0000 (15:29 +0100)]
Merge pull request #3683 from dbussink/dbussink/better-openssl-ciphers

Setup better defaults for OpenSSL ciphers

8 years agoUse general cl_git_fail because the error is generic
Dirkjan Bussink [Mon, 14 Mar 2016 12:41:41 +0000 (12:41 +0000)]
Use general cl_git_fail because the error is generic

8 years agoStart error string with lower case character
Dirkjan Bussink [Mon, 14 Mar 2016 12:41:12 +0000 (12:41 +0000)]
Start error string with lower case character

8 years agoSetup better defaults for OpenSSL ciphers
Dirkjan Bussink [Mon, 14 Mar 2016 12:02:00 +0000 (12:02 +0000)]
Setup better defaults for OpenSSL ciphers

This ensures that when using OpenSSL a safe default set of ciphers
is selected. This is done so that the client communicates securely
and we don't accidentally enable unsafe ciphers like RC4, or even
worse some old export ciphers.

Implements the first part of https://github.com/libgit2/libgit2/issues/3682

8 years agoRemove CI support for mingw32
Carlos Martín Nieto [Wed, 9 Mar 2016 18:01:33 +0000 (19:01 +0100)]
Remove CI support for mingw32

The tests have never run successfully and we do have successful builds
of mingw-w64, so remove these CI builds which do not add value.

8 years agoMerge pull request #3636 from nerdishbynature/fix-non-modular-header-in-module
Carlos Martín Nieto [Fri, 11 Mar 2016 15:31:32 +0000 (16:31 +0100)]
Merge pull request #3636 from nerdishbynature/fix-non-modular-header-in-module

Don't include inttypes if compiling for Mac/iOS

8 years agoconfig_cache: check return value of `git_config__lookup_entry`
Patrick Steinhardt [Thu, 10 Mar 2016 16:21:02 +0000 (17:21 +0100)]
config_cache: check return value of `git_config__lookup_entry`

Callers of `git_config__cvar` already handle the case where the
function returns an error due to a failed configuration variable
lookup, but we are actually swallowing errors when calling
`git_config__lookup_entry` inside of the function.

Fix this by returning early when `git_config__lookup_entry`
returns an error. As we call `git_config__lookup_entry` with
`no_errors == false` which leads us to call `get_entry` with
`GET_NO_MISSING` we will not return early when the lookup fails
due to a missing entry. Like this we are still able to set the
default value of the cvar and exit successfully.

8 years agofilebuf: handle write error in `lock_file`
Patrick Steinhardt [Thu, 10 Mar 2016 16:05:30 +0000 (17:05 +0100)]
filebuf: handle write error in `lock_file`

When writing to a file with locking not check if writing the
locked file actually succeeds. Fix the issue by returning error
code and message when writing fails.

8 years agoconfig_file: handle error when trying to lock strmap
Patrick Steinhardt [Thu, 10 Mar 2016 15:52:09 +0000 (16:52 +0100)]
config_file: handle error when trying to lock strmap

Accessing the current values map is handled through the
`refcounder_strmap_take` function, which first acquires a mutex
before accessing its values. While this assures everybody is
trying to access the values with the mutex only we do not check
if the locking actually succeeds.

Fix the issue by checking if acquiring the lock succeeds and
returning `NULL` if we encounter an error. Adjust callers.

8 years agoblame: handle error when resoling HEAD in normalize_options
Patrick Steinhardt [Thu, 10 Mar 2016 15:42:55 +0000 (16:42 +0100)]
blame: handle error when resoling HEAD in normalize_options

When normalizing options we try to look up HEAD's OID. While this
action may fail in malformed repositories we never check the
return value of the function.

Fix the issue by converting `normalize_options` to actually
return an error and handle the error in `git_blame_file`.

8 years agoblame_git: handle error returned by `git_commit_parent`
Patrick Steinhardt [Thu, 10 Mar 2016 15:33:49 +0000 (16:33 +0100)]
blame_git: handle error returned by `git_commit_parent`

8 years agorefdb_fs: fail if refcache returns NULL pointer
Patrick Steinhardt [Thu, 10 Mar 2016 15:11:51 +0000 (16:11 +0100)]
refdb_fs: fail if refcache returns NULL pointer

We usually check entries returned by `git_sortedcache_entry` for
NULL pointers. As we have a write lock in `packed_write`, though,
it really should not happen that the function returns NULL.

Assert that ref is not NULL to silence a Coverity warning.

8 years agocoverity: report errors when uploading tarball
Patrick Steinhardt [Wed, 2 Mar 2016 00:50:34 +0000 (01:50 +0100)]
coverity: report errors when uploading tarball

Curl by default does not report errors by setting the error code.
As the upload can fail through several conditions (e.g. the rate
limit, leading to unauthorized access) we should indicate this
information in Travis CI.

To improve upon the behavior, use `--write-out=%{http_code}` to
write out the HTTP code in addition to the received body and
return an error if the code does not equal 201.

8 years agodiff_tform: fix potential NULL pointer access
Patrick Steinhardt [Thu, 10 Mar 2016 09:40:47 +0000 (10:40 +0100)]
diff_tform: fix potential NULL pointer access

When the user passes in a diff which has no repository associated
we may call `git_config__get_int_force` with a NULL-pointer
configuration. Even though `git_config__get_int_force` is
designed to swallow errors, it is not intended to be called with
a NULL pointer configuration.

Fix the issue by only calling `git_config__get_int_force` only
when configuration could be retrieved from the repository.

8 years agosubmodule: avoid passing NULL pointers to strncmp
Patrick Steinhardt [Tue, 1 Mar 2016 18:11:33 +0000 (19:11 +0100)]
submodule: avoid passing NULL pointers to strncmp

In C89 it is undefined behavior to pass `NULL` pointers to
`strncmp` and later on in C99 it has been explicitly stated that
functions with an argument declared as `size_t nmemb` specifying
the array length shall always have valid parameters, no matter if
`nmemb` is 0 or not (see ISO 9899 §7.21.1.2).

The function `str_equal_no_trailing_slash` always passes its
parameters to `strncmp` if their lengths match. This means if one
parameter is `NULL` and the other one either `NULL` or a string
with length 0 we will pass the pointers to `strncmp` and cause
undefined behavior.

Fix this by explicitly handling the case when both lengths are 0.

8 years agopack-objects: fix memory leak on overflow
Patrick Steinhardt [Tue, 1 Mar 2016 16:55:40 +0000 (17:55 +0100)]
pack-objects: fix memory leak on overflow

8 years agoindex: assert required OID are non-NULL
Patrick Steinhardt [Tue, 1 Mar 2016 15:00:49 +0000 (16:00 +0100)]
index: assert required OID are non-NULL

8 years agoobject: avoid call of memset with ouf of bounds pointer
Patrick Steinhardt [Tue, 1 Mar 2016 14:35:45 +0000 (15:35 +0100)]
object: avoid call of memset with ouf of bounds pointer

When computing a short OID we do this by first copying the
leading parts into the new OID structure and then setting the
trailing part to zero. In the case of the desired length being
`GIT_OID_HEXSZ - 1` we will call `memset` with an out of bounds
pointer and a length of 0. While this seems to cause no problems
for common platforms the C89 standard does not explicitly state
that calling `memset` with an out of bounds pointer and
length of 0 is valid.

Fix the potential issue by using the newly introduced
`git_oid__cpy_prefix` function.

8 years agoCheck for __CLANG_INTTYPES_H
Piet Brauer [Thu, 25 Feb 2016 10:15:02 +0000 (18:15 +0800)]
Check for __CLANG_INTTYPES_H

This fixes an issue in Xcode 7.3 in objective-git where we get the error
"Include of non-modular header file in module". Not importing this
header again fixes the issue.

8 years agoconfig_file: handle missing quotation marks in section header
Patrick Steinhardt [Tue, 1 Mar 2016 13:40:17 +0000 (14:40 +0100)]
config_file: handle missing quotation marks in section header

When parsing a section header we expect something along the
format of '[section "subsection"]'. When a section is
mal-formated and is entirely missing its quotation marks we catch
this case by observing that `strchr(line, '"') - strrchr(line,
'"') = NULL - NULL = 0` and error out. Unfortunately, the error
message is misleading though, as we state that we are missing the
closing quotation mark while we in fact miss both quotation
marks.

Improve the error message by explicitly checking if the first
quotation mark could be found and, if not, stating that quotation
marks are completely missing.

8 years agodescribe: handle error code returned by git_pqueue_insert
Patrick Steinhardt [Tue, 1 Mar 2016 13:24:09 +0000 (14:24 +0100)]
describe: handle error code returned by git_pqueue_insert

8 years agoMerge pull request #3623 from ethomson/rebase_with_commit
Carlos Martín Nieto [Wed, 9 Mar 2016 22:45:33 +0000 (23:45 +0100)]
Merge pull request #3623 from ethomson/rebase_with_commit

rebase: additional setup tests of exotic behavior

8 years agoMerge pull request #3672 from libgit2/cmn/do-fail-appveyor
Carlos Martín Nieto [Wed, 9 Mar 2016 20:37:39 +0000 (21:37 +0100)]
Merge pull request #3672 from libgit2/cmn/do-fail-appveyor

appveyor: stop if the first test fails

8 years agoappveyor: stop if the first test fails
Carlos Martín Nieto [Wed, 9 Mar 2016 18:20:38 +0000 (19:20 +0100)]
appveyor: stop if the first test fails

8 years agoMerge pull request #3670 from libgit2/vmg/expand-fixes
Edward Thomson [Wed, 9 Mar 2016 18:12:34 +0000 (18:12 +0000)]
Merge pull request #3670 from libgit2/vmg/expand-fixes

Fixes for `gid_odb_expand_ids`

8 years agoodb: Try to lookup headers in all backends before passthrough
Vicent Marti [Wed, 9 Mar 2016 16:47:53 +0000 (17:47 +0100)]
odb: Try to lookup headers in all backends before passthrough

8 years agoodb: Refactor `git_odb_expand_ids`
Vicent Marti [Wed, 9 Mar 2016 15:41:08 +0000 (16:41 +0100)]
odb: Refactor `git_odb_expand_ids`

8 years agoodb: Implement new helper to read types without refreshing
Vicent Marti [Wed, 9 Mar 2016 10:29:46 +0000 (11:29 +0100)]
odb: Implement new helper to read types without refreshing

8 years agoMerge pull request #3668 from libgit2/cmn/mwindow-try-harder
Edward Thomson [Wed, 9 Mar 2016 14:51:13 +0000 (14:51 +0000)]
Merge pull request #3668 from libgit2/cmn/mwindow-try-harder

mwindow: free unused windows if we fail to mmap

8 years agomwindow: free unused windows if we fail to mmap
Carlos Martín Nieto [Wed, 9 Mar 2016 10:16:16 +0000 (11:16 +0100)]
mwindow: free unused windows if we fail to mmap

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.

8 years agoodb: Handle corner cases in `git_odb_expand_ids`
Vicent Marti [Wed, 9 Mar 2016 10:00:27 +0000 (11:00 +0100)]
odb: Handle corner cases in `git_odb_expand_ids`

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.

8 years agoMerge pull request #3656 from ethomson/exists_prefixes
Vicent Marti [Tue, 8 Mar 2016 20:17:38 +0000 (21:17 +0100)]
Merge pull request #3656 from ethomson/exists_prefixes

Introduce `git_odb_expand_ids`

8 years agogit_odb_expand_ids: accept git_odb_expand_id array
Edward Thomson [Tue, 8 Mar 2016 19:09:55 +0000 (14:09 -0500)]
git_odb_expand_ids: accept git_odb_expand_id array

Take (and write to) an array of a struct, `git_odb_expand_id`.

8 years agogit_odb_expand_ids: rename func, return the type
Edward Thomson [Tue, 8 Mar 2016 16:44:21 +0000 (11:44 -0500)]
git_odb_expand_ids: rename func, return the type

8 years agoMerge pull request #3555 from cbargren/ssh-git-protocols
Edward Thomson [Tue, 8 Mar 2016 13:38:55 +0000 (13:38 +0000)]
Merge pull request #3555 from cbargren/ssh-git-protocols

Support for ssh+git and git+ssh protocols

8 years agoMerge pull request #3652 from libgit2/cmn/commit-to-memory
Edward Thomson [Tue, 8 Mar 2016 13:35:11 +0000 (13:35 +0000)]
Merge pull request #3652 from libgit2/cmn/commit-to-memory

commit: split creating the commit and writing it out

8 years agocommit: split creating the commit and writing it out
Carlos Martín Nieto [Thu, 3 Mar 2016 21:56:02 +0000 (22:56 +0100)]
commit: split creating the commit and writing it out

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.

8 years agoMerge pull request #3655 from ethomson/nanosecond_defaults
Carlos Martín Nieto [Tue, 8 Mar 2016 09:43:33 +0000 (10:43 +0100)]
Merge pull request #3655 from ethomson/nanosecond_defaults

Enable nanosecond resolution by default

8 years agoindex::racy: force racy entry
Edward Thomson [Mon, 7 Mar 2016 22:37:17 +0000 (17:37 -0500)]
index::racy: force racy entry

Instead of hoping that we can get a racy entry by going real fast
and praying real hard, just create a racy entry.

8 years agoMerge pull request #3658 from patrickmckenna/update-pro-git-link
Edward Thomson [Tue, 8 Mar 2016 01:45:29 +0000 (01:45 +0000)]
Merge pull request #3658 from patrickmckenna/update-pro-git-link

Update link to Pro Git's Git internals chapter

8 years agoUpdate link to Pro Git's Git internals chapter.
Patrick McKenna [Tue, 8 Mar 2016 00:34:30 +0000 (16:34 -0800)]
Update link to Pro Git's Git internals chapter.

8 years agoindex::nsec: don't expect shit filesystems to not suck
Edward Thomson [Mon, 7 Mar 2016 22:04:32 +0000 (17:04 -0500)]
index::nsec: don't expect shit filesystems to not suck

If the underlying filesystem doesn't support better than one
second resolution, then don't expect that turning on `GIT_USE_NSEC`
does anything magical to change that.

8 years agogit_odb_exists_many_prefixes: query odb for multiple short ids
Edward Thomson [Fri, 4 Mar 2016 05:50:35 +0000 (00:50 -0500)]
git_odb_exists_many_prefixes: query odb for multiple short ids

Query the object database for multiple objects at a time, given their
object ID (which may be abbreviated) and optional type.

8 years agoodb: improved not found error messages
Edward Thomson [Fri, 4 Mar 2016 06:18:30 +0000 (01:18 -0500)]
odb: improved not found error messages

When looking up an abbreviated oid, show the actual (abbreviated) oid
the caller passed instead of a full (but ambiguously truncated) oid.

8 years agomerge::workdir::dirty: update to use `st_ctime_nsec`
Edward Thomson [Mon, 7 Mar 2016 14:37:51 +0000 (09:37 -0500)]
merge::workdir::dirty: update to use `st_ctime_nsec`

Update unit test to use newfangled `st_ctime_nsec`, which provides
indirection to the platform-correct name.

8 years agoMerge pull request #3653 from libgit2/cmn/treebuilder-submodule
Edward Thomson [Fri, 4 Mar 2016 13:50:23 +0000 (13:50 +0000)]
Merge pull request #3653 from libgit2/cmn/treebuilder-submodule

treebuilder: don't try to verify submodules exist in the odb

8 years agotreebuilder: don't try to verify submodules exist in the odb
Carlos Martín Nieto [Fri, 4 Mar 2016 11:34:38 +0000 (12:34 +0100)]
treebuilder: don't try to verify submodules exist in the odb

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.

8 years agoMerge pull request #3651 from libgit2/cmn/init-libssh2
Edward Thomson [Thu, 3 Mar 2016 22:57:45 +0000 (22:57 +0000)]
Merge pull request #3651 from libgit2/cmn/init-libssh2

ssh: initialize libssh2

8 years agossh: initialize libssh2
Carlos Martín Nieto [Thu, 3 Mar 2016 21:26:31 +0000 (22:26 +0100)]
ssh: initialize libssh2

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.

8 years agoMerge pull request #3639 from srajko/threading-openssl-libssh2
Carlos Martín Nieto [Thu, 3 Mar 2016 20:20:33 +0000 (21:20 +0100)]
Merge pull request #3639 from srajko/threading-openssl-libssh2

Expand OpenSSL and libssh2 thread safety documentation

8 years agoEnable nanosecond resolution by default
Edward Thomson [Thu, 3 Mar 2016 20:08:12 +0000 (15:08 -0500)]
Enable nanosecond resolution by default

Nanosecond resolution is now the default in git itself.  Enable this
as our default as well.

8 years agotests: take the version from our define
Carlos Martín Nieto [Thu, 3 Mar 2016 20:03:10 +0000 (21:03 +0100)]
tests: take the version from our define

8 years agoBump version to 0.24.0
Carlos Martín Nieto [Thu, 3 Mar 2016 19:20:43 +0000 (20:20 +0100)]
Bump version to 0.24.0

8 years agoCHANGELOG: prepre tamplate for release
Carlos Martín Nieto [Thu, 3 Mar 2016 19:18:55 +0000 (20:18 +0100)]
CHANGELOG: prepre tamplate for release

8 years agoCHANGELOG: add note about WinHTTP cred handling
Carlos Martín Nieto [Thu, 3 Mar 2016 19:17:13 +0000 (20:17 +0100)]
CHANGELOG: add note about WinHTTP cred handling

8 years agoMerge pull request #3648 from libgit2/cmn/auth-retry
Carlos Martín Nieto [Thu, 3 Mar 2016 19:11:18 +0000 (20:11 +0100)]
Merge pull request #3648 from libgit2/cmn/auth-retry

test: make sure we retry the auth callback on all platforms

8 years agotests: create a ctest target for cred_callback
Carlos Martín Nieto [Thu, 3 Mar 2016 18:21:07 +0000 (19:21 +0100)]
tests: create a ctest target for cred_callback

8 years agoMerge pull request #3646 from pks-t/pks/xdiff-fix-from-upstream
Carlos Martín Nieto [Thu, 3 Mar 2016 11:14:02 +0000 (12:14 +0100)]
Merge pull request #3646 from pks-t/pks/xdiff-fix-from-upstream

xdiff: fix memleak on error case

8 years agowinhttp: retry authentication
Carlos Martín Nieto [Thu, 3 Mar 2016 09:48:24 +0000 (10:48 +0100)]
winhttp: retry authentication

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.

8 years agotest: make sure we retry the auth callback on all platforms
Carlos Martín Nieto [Thu, 3 Mar 2016 09:08:00 +0000 (10:08 +0100)]
test: make sure we retry the auth callback on all platforms

We were missing this test on Windows, which meant we didn't notice that
we never fixed the single authentication attempt it tries, nor its wrong
return code.

Enable this for the unix platforms as well over HTTP. We previously were
doing it locally but disabled it on OS X due to issues with its sshd not
accepting password authentication.

8 years agotests: plug a leak
Carlos Martín Nieto [Thu, 3 Mar 2016 10:17:36 +0000 (11:17 +0100)]
tests: plug a leak

8 years agoMerge pull request #3633 from ethomson/safe_creation
Edward Thomson [Tue, 1 Mar 2016 17:16:27 +0000 (17:16 +0000)]
Merge pull request #3633 from ethomson/safe_creation

Stricter object dependency checking during creation

8 years agoxdiff: fix memleak on error case
Patrick Steinhardt [Tue, 1 Mar 2016 07:54:00 +0000 (08:54 +0100)]
xdiff: fix memleak on error case

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

8 years agoMerge pull request #3567 from sba1/few-p_getaddrinfo-fixes
Edward Thomson [Mon, 29 Feb 2016 01:13:24 +0000 (20:13 -0500)]
Merge pull request #3567 from sba1/few-p_getaddrinfo-fixes

Few p_getaddrinfo fixes

8 years agorebase: additional tests for completing a rebase
Edward Thomson [Mon, 29 Feb 2016 01:10:44 +0000 (20:10 -0500)]
rebase: additional tests for completing a rebase

8 years agoturn on strict object validation by default
Edward Thomson [Sun, 28 Feb 2016 20:51:38 +0000 (15:51 -0500)]
turn on strict object validation by default

8 years agotests: use legitimate object ids
Edward Thomson [Sun, 28 Feb 2016 21:02:49 +0000 (16:02 -0500)]
tests: use legitimate object ids

Use legitimate (existing) object IDs in tests so that we have the
ability to turn on strict object validation when running tests.

8 years agorefs: honor strict object creation
Edward Thomson [Sun, 28 Feb 2016 20:11:15 +0000 (15:11 -0500)]
refs: honor strict object creation

8 years agogit_object__is_valid: use `odb_read_header`
Edward Thomson [Sun, 28 Feb 2016 19:37:37 +0000 (14:37 -0500)]
git_object__is_valid: use `odb_read_header`

This allows lighter weight validation in `git_object__is_valid` that
does not require reading the entire object.

8 years agogit_index_add: validate objects in index entries (optionally)
Edward Thomson [Tue, 23 Feb 2016 23:29:16 +0000 (18:29 -0500)]
git_index_add: validate objects in index entries (optionally)

When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the index entries given to `git_index_add`.

8 years agoMerge pull request #3644 from ethomson/debug_pool
Carlos Martín Nieto [Sun, 28 Feb 2016 18:43:45 +0000 (19:43 +0100)]
Merge pull request #3644 from ethomson/debug_pool

travis ci: enable debug pool for valgrind builds

8 years agotreebuilder: validate tree entries (optionally)
Edward Thomson [Tue, 23 Feb 2016 20:00:27 +0000 (15:00 -0500)]
treebuilder: validate tree entries (optionally)

When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to treebuilder insertion.

8 years agogit_commit: validate tree and parent ids
Edward Thomson [Tue, 23 Feb 2016 18:34:35 +0000 (13:34 -0500)]
git_commit: validate tree and parent ids

When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to commit creation functions.

8 years agogit_object__is_valid: simple object validity test
Edward Thomson [Tue, 23 Feb 2016 18:33:10 +0000 (13:33 -0500)]
git_object__is_valid: simple object validity test

8 years agogit_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`
Edward Thomson [Tue, 23 Feb 2016 04:46:50 +0000 (23:46 -0500)]
git_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`

8 years agotravis ci: enable debug pool for valgrind builds
Edward Thomson [Sun, 28 Feb 2016 16:34:36 +0000 (11:34 -0500)]
travis ci: enable debug pool for valgrind builds

8 years agoMerge pull request #3577 from rossdylan/rossdylan/pooldebug
Edward Thomson [Sun, 28 Feb 2016 16:31:10 +0000 (11:31 -0500)]
Merge pull request #3577 from rossdylan/rossdylan/pooldebug

Add a new build flag to disable the pool allocator

8 years agoExpand OpenSSL and libssh2 thread safety documentation
Stjepan Rajko [Thu, 25 Feb 2016 22:19:51 +0000 (15:19 -0700)]
Expand OpenSSL and libssh2 thread safety documentation

8 years agoFixed typo in one of the ifndef's in pool.h used to enable/disable debug mode
Ross Delinger [Fri, 26 Feb 2016 17:51:13 +0000 (12:51 -0500)]
Fixed typo in one of the ifndef's in pool.h used to enable/disable debug mode

8 years agoMerge pull request #3638 from ethomson/nsec
Carlos Martín Nieto [Thu, 25 Feb 2016 17:42:09 +0000 (18:42 +0100)]
Merge pull request #3638 from ethomson/nsec

USE_NSECS fixes

8 years agoMerge pull request #3628 from pks-t/pks/coverity-fixes
Edward Thomson [Thu, 25 Feb 2016 17:09:49 +0000 (12:09 -0500)]
Merge pull request #3628 from pks-t/pks/coverity-fixes

Coverity fixes

8 years agoMerge pull request #3630 from libgit2/cmn/idx-extra-check
Edward Thomson [Thu, 25 Feb 2016 16:59:00 +0000 (11:59 -0500)]
Merge pull request #3630 from libgit2/cmn/idx-extra-check

Extra checks for packfile indices

8 years agonsec: support NDK's crazy nanoseconds
Edward Thomson [Thu, 25 Feb 2016 16:23:19 +0000 (11:23 -0500)]
nsec: support NDK's crazy nanoseconds

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).

8 years agonsec: update staging test for GIT_USE_NSECS
Edward Thomson [Thu, 25 Feb 2016 16:31:18 +0000 (11:31 -0500)]
nsec: update staging test for GIT_USE_NSECS

The index::nsec::staging_maintains_other_nanos test was created to
ensure that when we stage an entry when GIT_USE_NSECS is *unset* that
we truncate the index entry and do not persist the (old, invalid)
nanosec values.  Ensure that when GIT_USE_NSECS is *set* that we do
not do that, and actually write the correct nanosecond values.

8 years agopack: don't allow a negative offset
Carlos Martín Nieto [Thu, 25 Feb 2016 14:46:59 +0000 (15:46 +0100)]
pack: don't allow a negative offset

8 years agopack: make sure we don't go out of bounds for extended entries
Carlos Martín Nieto [Tue, 23 Feb 2016 17:15:43 +0000 (18:15 +0100)]
pack: make sure we don't go out of bounds for extended entries

A corrupt index might have data that tells us to go look past the end of
the file for data. Catch these cases and return an appropriate error
message.

8 years agoMerge pull request #3637 from libgit2/cmn/conventions
Edward Thomson [Thu, 25 Feb 2016 14:08:23 +0000 (09:08 -0500)]
Merge pull request #3637 from libgit2/cmn/conventions

CONVENTIONS: update to include general public API principles

8 years agoCONVENTIONS: update to include general public API principles
Carlos Martín Nieto [Thu, 25 Feb 2016 13:51:00 +0000 (14:51 +0100)]
CONVENTIONS: update to include general public API principles

8 years agoopenssl: we already had the function, just needed the header
Carlos Martín Nieto [Wed, 24 Feb 2016 16:17:57 +0000 (17:17 +0100)]
openssl: we already had the function, just needed the header

8 years agoopenssl: export the locking function when building without OpenSSL
Carlos Martín Nieto [Wed, 24 Feb 2016 15:38:22 +0000 (16:38 +0100)]
openssl: export the locking function when building without OpenSSL

This got lost duing the move and it lets the users call this function
just in case.

8 years agoMerge pull request #3631 from ethomson/giterr_fixups
Carlos Martín Nieto [Tue, 23 Feb 2016 21:27:36 +0000 (22:27 +0100)]
Merge pull request #3631 from ethomson/giterr_fixups

Minor `giterr` fixups

8 years agogiterr_set_str: remove `GITERR_OS` documentation
Edward Thomson [Tue, 23 Feb 2016 18:05:49 +0000 (13:05 -0500)]
giterr_set_str: remove `GITERR_OS` documentation

The `giterr_set_str` does not actually honor `GITERR_OS`.  Remove
the documentation that claims that we do.

8 years agomap: use `giterr_set` internally
Edward Thomson [Tue, 23 Feb 2016 18:02:07 +0000 (13:02 -0500)]
map: use `giterr_set` internally

Use the `giterr_set` function, which actually supports `GITERR_OS`.
The `giterr_set_str` function is exposed for external users and will
not append the operating system's error message.

8 years agodiff_tform: fix potential NULL pointer access
Patrick Steinhardt [Tue, 23 Feb 2016 10:07:03 +0000 (11:07 +0100)]
diff_tform: fix potential NULL pointer access

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.

8 years agoxmerge: fix memory leak on error path
Patrick Steinhardt [Mon, 22 Feb 2016 16:13:23 +0000 (17:13 +0100)]
xmerge: fix memory leak on error path