]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years agoMerge pull request #2886 from jeffhostetler/jeffhostetler/clar_trace
Carlos Martín Nieto [Wed, 4 Mar 2015 13:32:23 +0000 (14:32 +0100)]
Merge pull request #2886 from jeffhostetler/jeffhostetler/clar_trace

Set up git_trace in clar test suite.

9 years agoMerge pull request #2945 from ethomson/empty_hashsig_heap
Carlos Martín Nieto [Wed, 4 Mar 2015 11:47:59 +0000 (12:47 +0100)]
Merge pull request #2945 from ethomson/empty_hashsig_heap

diff_tform: don't compare empty hashsig_heaps

9 years agodiff_tform: account for whitespace options
Edward Thomson [Wed, 4 Mar 2015 04:56:54 +0000 (23:56 -0500)]
diff_tform: account for whitespace options

When comparing seemingly blank files, take whitespace options into
account.

9 years agoPlug a few leaks
Carlos Martín Nieto [Tue, 3 Mar 2015 23:29:37 +0000 (00:29 +0100)]
Plug a few leaks

9 years agodiff_tform: don't compare empty hashsig_heaps
Edward Thomson [Tue, 3 Mar 2015 23:19:42 +0000 (18:19 -0500)]
diff_tform: don't compare empty hashsig_heaps

Don't try to compare two empty hashsig_heaps.

9 years agoMerge pull request #2941 from libgit2/cmn/http-enforce-cred
Edward Thomson [Tue, 3 Mar 2015 22:59:44 +0000 (17:59 -0500)]
Merge pull request #2941 from libgit2/cmn/http-enforce-cred

http: enforce the credential types

9 years agoMerge pull request #2771 from libgit2/cmn/config-borrow-entry
Edward Thomson [Tue, 3 Mar 2015 22:59:20 +0000 (17:59 -0500)]
Merge pull request #2771 from libgit2/cmn/config-borrow-entry

Borrowing configuration entries

9 years agoconfig: borrow refcounted references
Carlos Martín Nieto [Sun, 21 Dec 2014 15:31:03 +0000 (15:31 +0000)]
config: borrow refcounted references

This changes the get_entry() method to return a refcounted version of
the config entry, which you have to free when you're done.

This allows us to avoid freeing the memory in which the entry is stored
on a refresh, which may happen at any time for a live config.

For this reason, get_string() has been forbidden on live configs and a
new function get_string_buf() has been added, which stores the string in
a git_buf which the user then owns.

The functions which parse the string value takea advantage of the
borrowing to parse safely and then release the entry.

9 years agohttp: enforce the credential types
Carlos Martín Nieto [Tue, 3 Mar 2015 16:23:01 +0000 (17:23 +0100)]
http: enforce the credential types

The user may decide to return any type of credential, including ones we
did not say we support. Add a check to make sure the user returned an
object of the right type and error out if not.

9 years agoRemove swp files
Carlos Martín Nieto [Tue, 3 Mar 2015 16:04:38 +0000 (17:04 +0100)]
Remove swp files

9 years agoMerge pull request #2934 from akikoskinen/mingw_build_fix
Edward Thomson [Tue, 3 Mar 2015 15:08:51 +0000 (10:08 -0500)]
Merge pull request #2934 from akikoskinen/mingw_build_fix

Fix build on mingw (master branch)

9 years agoMerge pull request #2913 from ethomson/stash_fixup
Edward Thomson [Tue, 3 Mar 2015 15:08:28 +0000 (10:08 -0500)]
Merge pull request #2913 from ethomson/stash_fixup

stash: correctly stash wd modified/index deleted

9 years agoMerge pull request #2808 from libgit2/cmn/repo-ident
Edward Thomson [Tue, 3 Mar 2015 15:07:36 +0000 (10:07 -0500)]
Merge pull request #2808 from libgit2/cmn/repo-ident

Remove the signature from ref-modifying functions

9 years agoConverted cl_perf_timer to use git__timer internally.
Jeff Hostetler [Tue, 3 Mar 2015 14:57:50 +0000 (09:57 -0500)]
Converted cl_perf_timer to use git__timer internally.

9 years agoUpdate CHANGELOG with the reflog ident changes
Carlos Martín Nieto [Fri, 6 Feb 2015 22:46:23 +0000 (23:46 +0100)]
Update CHANGELOG with the reflog ident changes

9 years agorepository: remove log message override for switching the active branch
Carlos Martín Nieto [Thu, 15 Jan 2015 15:50:31 +0000 (16:50 +0100)]
repository: remove log message override for switching the active branch

We want to use the "checkout: moving from ..." message in order to let
git know when a change of branch has happened. Make the convenience
functions for this goal write this message.

9 years agopush: remove reflog message override
Carlos Martín Nieto [Thu, 15 Jan 2015 14:31:23 +0000 (15:31 +0100)]
push: remove reflog message override

We always use "update by push".

9 years agobranch: don't accept a reflog message override
Carlos Martín Nieto [Wed, 7 Jan 2015 14:47:02 +0000 (14:47 +0000)]
branch: don't accept a reflog message override

This namespace is about behaving like git's branch command, so let's do
exactly that instead of taking a reflog message.

This override is still available via the reference namespace.

9 years agoreset: remove reflog message override
Carlos Martín Nieto [Wed, 7 Jan 2015 14:16:50 +0000 (14:16 +0000)]
reset: remove reflog message override

This function is meant to simulate what git does in the reset command,
so we should include the reflog message in that.

9 years agoRemove the signature from ref-modifying functions
Carlos Martín Nieto [Wed, 7 Jan 2015 12:23:05 +0000 (12:23 +0000)]
Remove the signature from ref-modifying functions

The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.

In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.

9 years agoMerge pull request #2885 from JIghtuse/master
Carlos Martín Nieto [Tue, 3 Mar 2015 13:35:10 +0000 (14:35 +0100)]
Merge pull request #2885 from JIghtuse/master

describe example: function to add commits to opts

9 years agoMerge pull request #2908 from ethomson/safe_create
Carlos Martín Nieto [Tue, 3 Mar 2015 12:47:13 +0000 (13:47 +0100)]
Merge pull request #2908 from ethomson/safe_create

Allow checkout to handle newly cloned repositories, remove `GIT_CHECKOUT_SAFE_CREATE`

9 years agobranch: do capture the error code
Carlos Martín Nieto [Tue, 3 Mar 2015 12:25:40 +0000 (13:25 +0100)]
branch: do capture the error code

We want to ignore GIT_ENOTFOUND, but for that we need to capture the
error code from the reflog deletion.

9 years agoMerge pull request #2937 from git-up/branch_delete_reflog
Carlos Martín Nieto [Tue, 3 Mar 2015 12:03:54 +0000 (13:03 +0100)]
Merge pull request #2937 from git-up/branch_delete_reflog

git_branch_delete() should ignore errors from non-existing reflogs

9 years agoMerge pull request #2935 from ethomson/dll_patchlevel
Carlos Martín Nieto [Mon, 2 Mar 2015 20:03:57 +0000 (21:03 +0100)]
Merge pull request #2935 from ethomson/dll_patchlevel

win32: add the patch level to the .dll fileversion

9 years agogit_branch_delete() should ignore errors from non-existing reflogs
Pierre-Olivier Latour [Mon, 2 Mar 2015 18:24:54 +0000 (10:24 -0800)]
git_branch_delete() should ignore errors from non-existing reflogs

9 years agowin32: add the patch level to the .dll fileversion
Edward Thomson [Mon, 2 Mar 2015 15:35:26 +0000 (10:35 -0500)]
win32: add the patch level to the .dll fileversion

Win32 DLLs have four fields for the version number (major, minor,
teeny, patch).  If a consumer wants to build a custom DLL, it may
be useful to set the patchlevel version number in the DLL.

This value only affects the DLL version number, it does not affect
the resultant "version number", which remains major.minor.teeny.

9 years agoAdded cl_perf_timer. Updated global trace to include timers.
Jeff Hostetler [Mon, 2 Mar 2015 14:21:55 +0000 (09:21 -0500)]
Added cl_perf_timer. Updated global trace to include timers.

9 years agoCleanup formatting of clar trace messages.
Jeff Hostetler [Mon, 2 Mar 2015 13:34:02 +0000 (08:34 -0500)]
Cleanup formatting of clar trace messages.

9 years agoProvide mechanism to let CLAR globally setup git_trace()
Jeff Hostetler [Fri, 13 Feb 2015 21:58:14 +0000 (16:58 -0500)]
Provide mechanism to let CLAR globally setup git_trace()

9 years agoInclude ws2tcpip.h in order to get in6_addr
Aki Koskinen [Fri, 27 Feb 2015 08:53:39 +0000 (10:53 +0200)]
Include ws2tcpip.h in order to get in6_addr

It's currently required in src/openssl_stream.c only.

9 years agoInclude openssl headers last
Aki Koskinen [Fri, 27 Feb 2015 08:49:02 +0000 (10:49 +0200)]
Include openssl headers last

Windows headers #define some names that openssl uses too. Openssl
headers #undef the offending names before reusing them. But if those
offending Windows headers get included after the openssl headers the
namespace is polluted and nothing good happens.

Fixes issue #2850.

9 years agoDon't include headers on windows that aren't available
Aki Koskinen [Mon, 2 Mar 2015 09:08:04 +0000 (11:08 +0200)]
Don't include headers on windows that aren't available

This mainly concerns mingw build.

9 years agoMerge pull request #2929 from ethomson/clar_update
Carlos Martín Nieto [Sun, 1 Mar 2015 20:04:51 +0000 (21:04 +0100)]
Merge pull request #2929 from ethomson/clar_update

Update to clar 2b73f5e

9 years agoMerge pull request #2928 from ethomson/rebase_alloc_check
Carlos Martín Nieto [Sun, 1 Mar 2015 20:00:11 +0000 (21:00 +0100)]
Merge pull request #2928 from ethomson/rebase_alloc_check

rebase: check alloc result

9 years agocheckout tests: just use SAFE where appropriate
Edward Thomson [Fri, 27 Feb 2015 16:02:37 +0000 (11:02 -0500)]
checkout tests: just use SAFE where appropriate

9 years agocheckout: remove `GIT_CHECKOUT_SAFE_CREATE` as a strategy
Edward Thomson [Sat, 14 Feb 2015 16:44:05 +0000 (11:44 -0500)]
checkout: remove `GIT_CHECKOUT_SAFE_CREATE` as a strategy

9 years agoexample: drop `SAFE_CREATE` from clone example
Edward Thomson [Sat, 14 Feb 2015 17:10:00 +0000 (12:10 -0500)]
example: drop `SAFE_CREATE` from clone example

9 years agoclone: drop now unnecessary SAFE_CREATE
Edward Thomson [Sat, 14 Feb 2015 15:46:41 +0000 (10:46 -0500)]
clone: drop now unnecessary SAFE_CREATE

9 years agocheckout: upgrade to `SAFE_CREATE` when no index file
Edward Thomson [Sat, 14 Feb 2015 15:33:06 +0000 (10:33 -0500)]
checkout: upgrade to `SAFE_CREATE` when no index file

When the repository does not contain an index, emulate git's behavior
and upgrade to `SAFE_CREATE`.  This allows us to check out repositories
created with `git clone --no-checkout`.

9 years agomerge perf test: drop unnecessary SAFE_CREATE
Edward Thomson [Sat, 14 Feb 2015 15:45:01 +0000 (10:45 -0500)]
merge perf test: drop unnecessary SAFE_CREATE

9 years agocherrypick, revert: drop unnecessary SAFE_CREATE
Edward Thomson [Sat, 14 Feb 2015 15:03:29 +0000 (10:03 -0500)]
cherrypick, revert: drop unnecessary SAFE_CREATE

9 years agoMerge pull request #2922 from ethomson/more_explaining_threads_is_more_better
Edward Thomson [Fri, 27 Feb 2015 05:37:20 +0000 (00:37 -0500)]
Merge pull request #2922 from ethomson/more_explaining_threads_is_more_better

README: provide some more explanation about TLS

9 years agoUpdate to clar 2b73f5e
Edward Thomson [Fri, 27 Feb 2015 05:30:50 +0000 (00:30 -0500)]
Update to clar 2b73f5e

9 years agorebase: check alloc result
Edward Thomson [Fri, 27 Feb 2015 04:39:54 +0000 (04:39 +0000)]
rebase: check alloc result

9 years agoREADME: provide some more explanation about TLS
Edward Thomson [Mon, 23 Feb 2015 16:18:52 +0000 (11:18 -0500)]
README: provide some more explanation about TLS

9 years agoMerge pull request #2921 from libgit2/ntk/macosx_build_cherrypicked
Carlos Martín Nieto [Fri, 20 Feb 2015 18:40:45 +0000 (19:40 +0100)]
Merge pull request #2921 from libgit2/ntk/macosx_build_cherrypicked

Fix MAX 32 bit build problem described in libgit2/libgit2#2917

9 years agoFix MAX 32 bit build problem described in libgit2/libgit2#2917
Jeff Hostetler [Fri, 20 Feb 2015 15:21:32 +0000 (10:21 -0500)]
Fix MAX 32 bit build problem described in libgit2/libgit2#2917

9 years agoMerge pull request #2907 from jasonhaslam/git_packfile_unpack_race
Carlos Martín Nieto [Fri, 20 Feb 2015 07:40:40 +0000 (08:40 +0100)]
Merge pull request #2907 from jasonhaslam/git_packfile_unpack_race

Fix race in git_packfile_unpack.

9 years agoMerge pull request #2911 from ethomson/streaming_filters
Carlos Martín Nieto [Thu, 19 Feb 2015 19:39:20 +0000 (20:39 +0100)]
Merge pull request #2911 from ethomson/streaming_filters

Streaming filters

9 years agotests: separate INVASIVE filesystem tests
Edward Thomson [Thu, 19 Feb 2015 17:14:06 +0000 (12:14 -0500)]
tests: separate INVASIVE filesystem tests

Introduce GITTEST_INVASIVE_FS_STRUCTURE for things that are invasive
to your filesystem structure (like creating folders at your filesystem
root) and GITTEST_INVASIVE_FS_SIZE for things that write lots of data.

9 years agofilter: take `temp_buf` in `git_filter_options`
Edward Thomson [Thu, 19 Feb 2015 16:32:55 +0000 (11:32 -0500)]
filter: take `temp_buf` in `git_filter_options`

9 years agofilter: add `git_filter_list__load_ext`
Edward Thomson [Thu, 19 Feb 2015 16:25:26 +0000 (11:25 -0500)]
filter: add `git_filter_list__load_ext`

Refactor `git_filter_list__load_with_attr_reader` into
`git_filter_list__load_ext`, which takes a `git_filter_options`.

9 years agogit_filter_opt_t -> git_filter_flag_t
Edward Thomson [Thu, 19 Feb 2015 16:09:54 +0000 (11:09 -0500)]
git_filter_opt_t -> git_filter_flag_t

For consistency with the rest of the library, where an opt is an
options *structure*.

9 years agobuffer: introduce git_buf_attach_notowned
Edward Thomson [Thu, 19 Feb 2015 15:05:33 +0000 (10:05 -0500)]
buffer: introduce git_buf_attach_notowned

Provide a convenience function that creates a buffer that can be provided
to callers but will not be freed via `git_buf_free`, so the buffer
creator maintains the allocation lifecycle of the buffer's contents.

9 years agoMerge pull request #2820 from leoyanggit/mac_build
Carlos Martín Nieto [Thu, 19 Feb 2015 10:19:17 +0000 (11:19 +0100)]
Merge pull request #2820 from leoyanggit/mac_build

Fix Mac build without OpenSSL

9 years agostash: correctly stash wd modified/index deleted
Edward Thomson [Wed, 18 Feb 2015 16:26:03 +0000 (11:26 -0500)]
stash: correctly stash wd modified/index deleted

9 years agocheckout: let the stream writer close the fd
Edward Thomson [Wed, 18 Feb 2015 14:40:52 +0000 (09:40 -0500)]
checkout: let the stream writer close the fd

9 years agofilter streams: base -> parent
Edward Thomson [Wed, 18 Feb 2015 14:28:07 +0000 (09:28 -0500)]
filter streams: base -> parent

9 years agogit_writestream: from git_filter_stream
Edward Thomson [Wed, 18 Feb 2015 14:25:32 +0000 (09:25 -0500)]
git_writestream: from git_filter_stream

9 years agofilter: test a large file through the stream
Edward Thomson [Tue, 17 Feb 2015 18:27:06 +0000 (13:27 -0500)]
filter: test a large file through the stream

Test pushing a file on-disk into a streaming filter that compresses
it into the ODB, and inflates it back into the working directory.

9 years agocheckout: maintain temporary buffer for filters
Edward Thomson [Tue, 17 Feb 2015 20:25:31 +0000 (20:25 +0000)]
checkout: maintain temporary buffer for filters

Let the filters use the checkout data's temporary buffer, instead
of having to allocate new buffers each time.

9 years agocheckout: stream the blob into the filters
Edward Thomson [Thu, 22 Jan 2015 22:11:36 +0000 (16:11 -0600)]
checkout: stream the blob into the filters

Use the new streaming filter API during checkout.

9 years agofilters: stream internally
Edward Thomson [Thu, 22 Jan 2015 22:11:22 +0000 (16:11 -0600)]
filters: stream internally

Migrate the `git_filter_list_apply_*` functions over to using the
new filter streams.

9 years agoFix Mac build without OpenSSL
Leo Yang [Fri, 13 Feb 2015 22:28:35 +0000 (17:28 -0500)]
Fix Mac build without OpenSSL

If OpenSSL is disabled on Mac the SHA1 implementation goes
to the CommonCrypto from the system. In this case we should
not include the generic hash impl. Otherwise there would be
duplicated impls which fail the build.

9 years agofilters: introduce streaming filters
Edward Thomson [Thu, 22 Jan 2015 22:10:06 +0000 (16:10 -0600)]
filters: introduce streaming filters

Add structures and preliminary functions to take a buffer, file or
blob and write the contents in chunks through an arbitrary number
of chained filters, finally writing into a user-provided function
accept the contents.

9 years agoMerge pull request #2909 from stewid/remove_extra_semicolon
Carlos Martín Nieto [Mon, 16 Feb 2015 02:14:32 +0000 (03:14 +0100)]
Merge pull request #2909 from stewid/remove_extra_semicolon

Remove extra semicolon outside of a function

9 years agoRemove extra semicolon outside of a function
Stefan Widgren [Sun, 15 Feb 2015 20:07:05 +0000 (21:07 +0100)]
Remove extra semicolon outside of a function

Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.

9 years agoFix race in git_packfile_unpack.
Jason Haslam [Sun, 15 Feb 2015 06:43:26 +0000 (23:43 -0700)]
Fix race in git_packfile_unpack.

Increment refcount of newly added cache entries just like existing
entries looked up from the cache. Otherwise the new entry can be
evicted from the cache and destroyed while it's still in use.

9 years agoMerge pull request #2831 from ethomson/merge_lock
Carlos Martín Nieto [Sun, 15 Feb 2015 04:18:01 +0000 (05:18 +0100)]
Merge pull request #2831 from ethomson/merge_lock

merge: lock index during the merge (not just checkout)

9 years agoMerge pull request #2895 from ethomson/alloc_overflow
Carlos Martín Nieto [Sun, 15 Feb 2015 04:13:50 +0000 (05:13 +0100)]
Merge pull request #2895 from ethomson/alloc_overflow

allocations: test for overflow of requested size

9 years agoMerge pull request #2903 from ethomson/rebase
Carlos Martín Nieto [Sun, 15 Feb 2015 04:03:51 +0000 (05:03 +0100)]
Merge pull request #2903 from ethomson/rebase

Fixups for rebase

9 years agoindexwriter: an indexwriter for repo operations
Edward Thomson [Wed, 4 Feb 2015 03:31:10 +0000 (22:31 -0500)]
indexwriter: an indexwriter for repo operations

Provide git_indexwriter_init_for_operation for the common locking
pattern in merge, rebase, revert and cherry-pick.

9 years agomerge-like operations: lock index while working
Edward Thomson [Wed, 4 Feb 2015 02:51:48 +0000 (21:51 -0500)]
merge-like operations: lock index while working

9 years agomerge: lock the index at the start of the merge
Edward Thomson [Sun, 18 Jan 2015 05:28:53 +0000 (23:28 -0600)]
merge: lock the index at the start of the merge

Always lock the index when we begin the merge, before we write
any of the metdata files.  This prevents a race where another
client may run a commit after we have written the MERGE_HEAD but
before we have updated the index, which will produce a merge
commit that is treesame to one parent.  The merge will finish and
update the index and the resultant commit would not be a merge at
all.

9 years agocheckout: introduce GIT_CHECKOUT_DONT_WRITE_INDEX
Edward Thomson [Sun, 18 Jan 2015 04:47:03 +0000 (22:47 -0600)]
checkout: introduce GIT_CHECKOUT_DONT_WRITE_INDEX

9 years agogit_indexwriter: lock then write the index
Edward Thomson [Sun, 18 Jan 2015 02:49:04 +0000 (20:49 -0600)]
git_indexwriter: lock then write the index

Introduce `git_indexwriter`, to allow us to lock the index while
performing additional operations, then complete the write (or abort,
unlocking the index).

9 years agomerge test: test an actual failure, not conflict
Edward Thomson [Sun, 18 Jan 2015 05:31:24 +0000 (23:31 -0600)]
merge test: test an actual failure, not conflict

Correct the merge failed cleanup test.  Merge data should not be
cleaned up on conflicts, only on actual failure.  And ORIG_HEAD
should not be removed at all.

9 years agorebase: `CHECKOUT_SAFE` instead of `FORCE`
Edward Thomson [Fri, 13 Feb 2015 16:38:00 +0000 (11:38 -0500)]
rebase: `CHECKOUT_SAFE` instead of `FORCE`

Switch to a standard branch-switching pattern of a `SAFE` checkout,
then updating `HEAD`.

9 years agorebase: allow `NULL` branch to indicate `HEAD`
Edward Thomson [Fri, 13 Feb 2015 16:20:32 +0000 (11:20 -0500)]
rebase: allow `NULL` branch to indicate `HEAD`

Don't require the branch to rebase, if given `NULL`, simply look up
`HEAD`.

9 years agorebase: provide NULL `exec` on non-EXEC operations
Edward Thomson [Fri, 13 Feb 2015 15:44:19 +0000 (10:44 -0500)]
rebase: provide NULL `exec` on non-EXEC operations

Users may want to try to pay attention to the `exec` field on all
rebase operations.

9 years agoMerge pull request #2901 from ethomson/win32_mode_bits
Carlos Martín Nieto [Fri, 13 Feb 2015 14:58:39 +0000 (15:58 +0100)]
Merge pull request #2901 from ethomson/win32_mode_bits

win32: limit the mode to `_wopen`/`_waccess`

9 years agopack-objects: unlock the cache on integer overflow
Edward Thomson [Fri, 13 Feb 2015 14:35:20 +0000 (09:35 -0500)]
pack-objects: unlock the cache on integer overflow

9 years agobuf test: cleanup memory leak
Edward Thomson [Fri, 13 Feb 2015 04:56:09 +0000 (23:56 -0500)]
buf test: cleanup memory leak

9 years agointeger overflow: use compiler intrinsics if supported
Edward Thomson [Thu, 12 Feb 2015 22:36:48 +0000 (17:36 -0500)]
integer overflow: use compiler intrinsics if supported

gcc and clang support __builtin_add_overflow, use it whenever
possible, falling back to our naive routines.

9 years agofilebuf: use an int for return check
Edward Thomson [Thu, 12 Feb 2015 22:14:53 +0000 (22:14 +0000)]
filebuf: use an int for return check

9 years agoMake our overflow check look more like gcc/clang's
Edward Thomson [Thu, 12 Feb 2015 17:19:37 +0000 (12:19 -0500)]
Make our overflow check look more like gcc/clang's

Make our overflow checking look more like gcc and clang's, so that
we can substitute it out with the compiler instrinsics on platforms
that support it.  This means dropping the ability to pass `NULL` as
an out parameter.

As a result, the macros also get updated to reflect this as well.

9 years agowin32: limit the mode to `_wopen`/`_waccess`
Edward Thomson [Fri, 13 Feb 2015 14:18:49 +0000 (09:18 -0500)]
win32: limit the mode to `_wopen`/`_waccess`

Win32 generally ignores Unix-like mode bits that don't make any
sense on the platform (eg `0644` makes no sense to Windows).  But
WINE complains loudly when presented with POSIXy bits.  Remove them.

(Thanks @phkelley)

9 years agoMerge pull request #2883 from urkud/reget-reader-pointer
Carlos Martín Nieto [Fri, 13 Feb 2015 07:56:01 +0000 (08:56 +0100)]
Merge pull request #2883 from urkud/reget-reader-pointer

Reinit `reader` pointer after reading included config file

9 years agoMerge pull request #2897 from leoyanggit/fix_fileop_warning
Carlos Martín Nieto [Fri, 13 Feb 2015 07:30:21 +0000 (08:30 +0100)]
Merge pull request #2897 from leoyanggit/fix_fileop_warning

Fix build warning on Android

9 years agoUpdate `khash.h` to pull request 42
Edward Thomson [Wed, 11 Feb 2015 22:51:17 +0000 (17:51 -0500)]
Update `khash.h` to pull request 42

https://github.com/attractivechaos/klib/pull/42/files introduces
`kreallocarray`.  Hook that up as our `git__reallocarray`.

9 years agokhash: update to klib f28c067
Edward Thomson [Wed, 11 Feb 2015 22:36:57 +0000 (17:36 -0500)]
khash: update to klib f28c067

9 years agoIntroduce git__add_sizet_overflow and friends
Edward Thomson [Wed, 11 Feb 2015 19:52:08 +0000 (14:52 -0500)]
Introduce git__add_sizet_overflow and friends

Add some helper functions to check for overflow in a type-specific
manner.

9 years agop_read: ensure requested len is ssize_t
Edward Thomson [Wed, 11 Feb 2015 18:01:00 +0000 (13:01 -0500)]
p_read: ensure requested len is ssize_t

Ensure that the given length to `p_read` is of ssize_t and ensure
that callers test the return as if it were an `ssize_t`.

9 years agoUse `size_t` to hold size of arrays
Edward Thomson [Wed, 11 Feb 2015 16:20:05 +0000 (11:20 -0500)]
Use `size_t` to hold size of arrays

Use `size_t` to hold the size of arrays to ease overflow checking,
lest we check for overflow of a `size_t` then promptly truncate
by packing the length into a smaller type.

9 years agooverflow checking: don't make callers set oom
Edward Thomson [Wed, 11 Feb 2015 14:39:38 +0000 (09:39 -0500)]
overflow checking: don't make callers set oom

Have the ALLOC_OVERFLOW testing macros also simply set_oom in the
case where a computation would overflow, so that callers don't
need to.

9 years agogit_buf_grow_by: increase buf asize incrementally
Edward Thomson [Wed, 11 Feb 2015 04:55:07 +0000 (23:55 -0500)]
git_buf_grow_by: increase buf asize incrementally

Introduce `git_buf_grow_by` to incrementally increase the size of a
`git_buf`, performing an overflow calculation on the growth.

9 years agogit__*allocarray: safer realloc and malloc
Edward Thomson [Wed, 11 Feb 2015 04:13:49 +0000 (23:13 -0500)]
git__*allocarray: safer realloc and malloc

Introduce git__reallocarray that checks the product of the number
of elements and element size for overflow before allocation.  Also
introduce git__mallocarray that behaves like calloc, but without the
`c`.  (It does not zero memory, for those truly worried about every
cycle.)

9 years agoodb__hashlink: check st.st_size before casting
Edward Thomson [Wed, 11 Feb 2015 03:34:03 +0000 (22:34 -0500)]
odb__hashlink: check st.st_size before casting

9 years agoallocations: test for overflow of requested size
Edward Thomson [Tue, 10 Feb 2015 04:41:13 +0000 (23:41 -0500)]
allocations: test for overflow of requested size

Introduce some helper macros to test integer overflow from arithmetic
and set error message appropriately.