]> git.proxmox.com Git - libgit2.git/log
libgit2.git
8 years agoMerge pull request #3607 from pks-t/pks/coverity-improvements
Carlos Martín Nieto [Thu, 11 Feb 2016 21:16:34 +0000 (22:16 +0100)]
Merge pull request #3607 from pks-t/pks/coverity-improvements

Coverity improvements for GITERR_CHECK_ALLOC

8 years agocoverity: use https URL for posting build
Patrick Steinhardt [Wed, 10 Feb 2016 10:06:23 +0000 (11:06 +0100)]
coverity: use https URL for posting build

When posting our instrumented build results to Coverity we have
to include sensitive information, in particular our authorization
token. Currently we use an unencrypted channel to post this
information, leading to the token being transferred in plain.

Fix this by using a secured connection instead.

8 years agocoverity: provide nodef for GITERR_CHECK_ALLOC
Patrick Steinhardt [Wed, 10 Feb 2016 09:59:14 +0000 (10:59 +0100)]
coverity: provide nodef for GITERR_CHECK_ALLOC

Coverity currently lists a lot of errors with regard to
GITERR_CHECK_ALLOC causing resource leaks. We know this macro is
only invoked when we want to abort because we are out of memory.

Coverity allows for overriding the default model where we know
that certain functions guarantee a desired behavior. The
user_nodefs.h is used to override the behavior of macros.
Re-define GITERR_CHECK_ALLOC inside of it to specify its abort
nature.

8 years agoMerge pull request #3599 from libgit2/gpgsign
Vicent Marti [Tue, 9 Feb 2016 15:26:58 +0000 (16:26 +0100)]
Merge pull request #3599 from libgit2/gpgsign

Introduce git_commit_extract_signature

8 years agoMerge pull request #3603 from pks-t/pks/coverity-fixes
Carlos Martín Nieto [Tue, 9 Feb 2016 15:10:43 +0000 (16:10 +0100)]
Merge pull request #3603 from pks-t/pks/coverity-fixes

Coverity fixes

8 years agoIntroduce git_commit_extract_signature
Carlos Martín Nieto [Mon, 8 Feb 2016 17:51:13 +0000 (18:51 +0100)]
Introduce git_commit_extract_signature

This returns the GPG signature for a commit and its contents without the
signature block, allowing for the verification of the commit's
signature.

8 years agoMerge pull request #3602 from libgit2/cmn/header-field-2
Carlos Martín Nieto [Tue, 9 Feb 2016 13:53:10 +0000 (14:53 +0100)]
Merge pull request #3602 from libgit2/cmn/header-field-2

commit: also match the first header field when searching

8 years agoattr_file: fix resource leak
Patrick Steinhardt [Tue, 9 Feb 2016 10:11:38 +0000 (11:11 +0100)]
attr_file: fix resource leak

8 years agocheckout: fix resource leak
Patrick Steinhardt [Tue, 9 Feb 2016 10:07:50 +0000 (11:07 +0100)]
checkout: fix resource leak

8 years agopack-objects: fix memory leak in packbuilder_config
Patrick Steinhardt [Tue, 9 Feb 2016 09:53:30 +0000 (10:53 +0100)]
pack-objects: fix memory leak in packbuilder_config

8 years agopack-objects: fix memory leak in compute_write_order
Patrick Steinhardt [Tue, 9 Feb 2016 09:43:28 +0000 (10:43 +0100)]
pack-objects: fix memory leak in compute_write_order

8 years agopack: do not free passed in poiter on error
Patrick Steinhardt [Tue, 9 Feb 2016 08:58:56 +0000 (09:58 +0100)]
pack: do not free passed in poiter on error

The function `git_packfile_stream_open` tries to free the passed
in stream when an error occurs. The only call site is
`git_indexer_append`, though, which passes in the address of a
stream struct which has not been allocated on the heap.

Fix the issue by simply removing the call to free. In case of an
error we did not allocate any memory yet and otherwise it should
be the caller's responsibility to manage it's object's lifetime.

8 years agocommit: also match the first header field when searching
Carlos Martín Nieto [Tue, 9 Feb 2016 06:17:26 +0000 (07:17 +0100)]
commit: also match the first header field when searching

We were searching only past the first header field, which meant we were
unable to find e.g. `tree` which is the first field.

While here, make sure to set an error message in case we cannot find the
field.

8 years agoMerge pull request #3598 from pks-t/pks/coverity-fixes
Carlos Martín Nieto [Tue, 9 Feb 2016 05:41:02 +0000 (06:41 +0100)]
Merge pull request #3598 from pks-t/pks/coverity-fixes

Coverity fixes

8 years agoMerge pull request #3601 from ethomson/merge_doc
Carlos Martín Nieto [Tue, 9 Feb 2016 05:26:21 +0000 (06:26 +0100)]
Merge pull request #3601 from ethomson/merge_doc

Better document `git_merge_commits` redux

8 years agoBetter document `git_merge_commits` redux
Edward Thomson [Tue, 9 Feb 2016 01:55:22 +0000 (17:55 -0800)]
Better document `git_merge_commits` redux

`git_merge_commits` and `git_merge` now *do* handle recursive base
building for criss-cross merges.  Remove the documentation that says
that they do not.

This reverts commit 5e44d9bcb6d5b20922f49b1913723186f8ced8b5.

8 years agoMerge pull request #3600 from ethomson/mailmap
Edward Thomson [Tue, 9 Feb 2016 01:14:43 +0000 (17:14 -0800)]
Merge pull request #3600 from ethomson/mailmap

mailmap: add ethomson@github.com

8 years agomailmap: add ethomson@github.com
Edward Thomson [Tue, 2 Feb 2016 22:50:35 +0000 (14:50 -0800)]
mailmap: add ethomson@github.com

8 years agocurl_stream: fix unused cert infos
Patrick Steinhardt [Mon, 8 Feb 2016 16:05:57 +0000 (17:05 +0100)]
curl_stream: fix unused cert infos

When copying contents of the cURL certiinfo we duplicate the
data but forget to actually put it into the vector.

8 years agomerge: fix memory leak
Patrick Steinhardt [Mon, 8 Feb 2016 15:58:08 +0000 (16:58 +0100)]
merge: fix memory leak

8 years agoMerge pull request #3592 from ethomson/code_of_conduct
Carlos Martín Nieto [Sun, 7 Feb 2016 00:41:59 +0000 (16:41 -0800)]
Merge pull request #3592 from ethomson/code_of_conduct

Introduce Contributor Covenant

8 years agoMerge pull request #3578 from bubaflub/fix_small_memory_leak
Carlos Martín Nieto [Fri, 5 Feb 2016 23:19:24 +0000 (15:19 -0800)]
Merge pull request #3578 from bubaflub/fix_small_memory_leak

Free allocated pointer to curl stream on error

8 years agoMerge pull request #3579 from ethomson/mingw_winhttp
Edward Thomson [Fri, 5 Feb 2016 17:37:40 +0000 (09:37 -0800)]
Merge pull request #3579 from ethomson/mingw_winhttp

winhttp: name mangle class / iid on mingw

8 years agoMerge pull request #3584 from jbreeden/export_fn
Edward Thomson [Fri, 5 Feb 2016 00:43:23 +0000 (16:43 -0800)]
Merge pull request #3584 from jbreeden/export_fn

Export git_stash_apply_init_options

8 years agoMerge pull request #3594 from Ephemera/patch-1
Edward Thomson [Thu, 4 Feb 2016 23:49:00 +0000 (15:49 -0800)]
Merge pull request #3594 from Ephemera/patch-1

Fix typo

8 years agoFix typo
Ephemera [Thu, 4 Feb 2016 16:59:07 +0000 (01:59 +0900)]
Fix typo

8 years agoMerge pull request #3593 from nvanheuverzwijn/patch-1
Edward Thomson [Thu, 4 Feb 2016 16:43:47 +0000 (08:43 -0800)]
Merge pull request #3593 from nvanheuverzwijn/patch-1

Fix a typo in documentation

8 years agoFix a typo in documentation
Nicolas Vanheuverzwijn [Wed, 3 Feb 2016 22:27:04 +0000 (17:27 -0500)]
Fix a typo in documentation

8 years agoIntroduce Contributor Covenant
Edward Thomson [Tue, 2 Feb 2016 22:49:25 +0000 (14:49 -0800)]
Introduce Contributor Covenant

8 years agoExport git_stash_apply_init_options
jbreeden [Sun, 24 Jan 2016 01:13:25 +0000 (17:13 -0800)]
Export git_stash_apply_init_options

8 years agowinhttp: name mangle class / iid on mingw
Edward Thomson [Tue, 19 Jan 2016 17:13:23 +0000 (11:13 -0600)]
winhttp: name mangle class / iid on mingw

Standard Windows type systems define CLSID_InternetSecurityManager
and IID_IInternetSecurityManager, but MinGW lacks these definitions.
As a result, we must hardcode these definitions ourselves.  However,
we should not use a public struct with those names, lest another
library do the same thing and consumers cannot link to both.

8 years agoFree allocated pointer to curl stream on error
Bob Kuo [Sun, 17 Jan 2016 01:39:24 +0000 (19:39 -0600)]
Free allocated pointer to curl stream on error

8 years agoMerge pull request #3573 from pmq20/master-12jan16
Carlos Martín Nieto [Sat, 16 Jan 2016 01:29:17 +0000 (02:29 +0100)]
Merge pull request #3573 from pmq20/master-12jan16

Make packfile_unpack_compressed a private API

8 years agoMerge pull request #3569 from arthurschreiber/arthur/fix-windows-issues
Carlos Martín Nieto [Wed, 13 Jan 2016 16:57:54 +0000 (17:57 +0100)]
Merge pull request #3569 from arthurschreiber/arthur/fix-windows-issues

Fix some issues with generated pkg-config file

8 years agoMake packfile_unpack_compressed a private API
P.S.V.R [Wed, 13 Jan 2016 03:02:38 +0000 (11:02 +0800)]
Make packfile_unpack_compressed a private API

8 years agoWrap path in quotes to support paths containing whitespace.
Arthur Schreiber [Tue, 5 Jan 2016 20:55:11 +0000 (21:55 +0100)]
Wrap path in quotes to support paths containing whitespace.

8 years agoAdd winhttp dependencies to pc file.
Arthur Schreiber [Tue, 5 Jan 2016 18:07:27 +0000 (19:07 +0100)]
Add winhttp dependencies to pc file.

8 years agoMerge pull request #3562 from mgorny/ssh-read-stderr-fail
Carlos Martín Nieto [Tue, 29 Dec 2015 13:38:01 +0000 (13:38 +0000)]
Merge pull request #3562 from mgorny/ssh-read-stderr-fail

ssh_stream_read(): fix possible *bytes_read < 0 branch

8 years agoMerge pull request #3558 from libgit2/cmn/index-nolock
Carlos Martín Nieto [Mon, 28 Dec 2015 15:12:37 +0000 (15:12 +0000)]
Merge pull request #3558 from libgit2/cmn/index-nolock

index: get rid of the locking

8 years agoindex: get rid of the locking
Carlos Martín Nieto [Wed, 23 Dec 2015 11:54:52 +0000 (11:54 +0000)]
index: get rid of the locking

We don't support using an index object from multiple threads at the same
time, so the locking doesn't have any effect when following the
rules. If not following the rules, things are going to break down
anyway.

8 years agoMerge pull request #3565 from ethomson/templates
Carlos Martín Nieto [Mon, 28 Dec 2015 11:22:48 +0000 (11:22 +0000)]
Merge pull request #3565 from ethomson/templates

Handle dotfiles as the repo template dir and inside the template dir

8 years agogit_repository_init: include dotfiles when copying templates
Edward Thomson [Sun, 27 Dec 2015 04:39:22 +0000 (22:39 -0600)]
git_repository_init: include dotfiles when copying templates

Include dotfiles when copying template directory, which will handle
both a template directory itself that begins with a dotfile, and
any dotfiles inside the directory.

8 years agorepo::init tests: test a template dir with leading dot
Edward Thomson [Sun, 27 Dec 2015 04:32:17 +0000 (22:32 -0600)]
repo::init tests: test a template dir with leading dot

Ensure that we can handle template directories that begin with a
leading dot.

8 years agorepo::init tests: test init.templatedir setting
Edward Thomson [Sun, 27 Dec 2015 04:06:45 +0000 (22:06 -0600)]
repo::init tests: test init.templatedir setting

Ensure that `git_repository_init` honors the `init.templatedir`
configuration setting.

8 years agoMerge pull request #3552 from ReadmeCritic/master
Edward Thomson [Sun, 27 Dec 2015 00:31:22 +0000 (18:31 -0600)]
Merge pull request #3552 from ReadmeCritic/master

Update README URLs based on HTTP redirects

8 years agoUpdate libgit2-glib link
ReadmeCritic [Sat, 26 Dec 2015 23:51:32 +0000 (15:51 -0800)]
Update libgit2-glib link

8 years agoMerge pull request #3546 from Cruel/master
Edward Thomson [Sat, 26 Dec 2015 22:55:29 +0000 (16:55 -0600)]
Merge pull request #3546 from Cruel/master

Fix a couple function signatures

8 years agossh_stream_read(): fix possible *bytes_read < 0 branch
Michał Górny [Sat, 26 Dec 2015 16:17:05 +0000 (17:17 +0100)]
ssh_stream_read(): fix possible *bytes_read < 0 branch

Fix the possibility of returning successfully from ssh_stream_read()
with *bytes_read < 0. This would occur if stdout channel read resulted
in 0, and stderr channel read failed afterwards.

8 years agoMerge pull request #3560 from drusk/readme_typo
Edward Thomson [Thu, 24 Dec 2015 05:38:59 +0000 (23:38 -0600)]
Merge pull request #3560 from drusk/readme_typo

Fixed minor typo in README.md.

8 years agoFixed minor typo in README.md.
drusk [Thu, 24 Dec 2015 05:27:40 +0000 (21:27 -0800)]
Fixed minor typo in README.md.

8 years agoMerge pull request #3554 from olshevskiy87/master
Carlos Martín Nieto [Mon, 21 Dec 2015 21:47:10 +0000 (21:47 +0000)]
Merge pull request #3554 from olshevskiy87/master

typos in comments

8 years agotypos in comments
Dmitriy Olshevskiy [Mon, 21 Dec 2015 17:49:14 +0000 (20:49 +0300)]
typos in comments

8 years agoUpdate README URLs based on HTTP redirects
ReadmeCritic [Thu, 17 Dec 2015 16:36:04 +0000 (08:36 -0800)]
Update README URLs based on HTTP redirects

8 years agoMerge pull request #3551 from libgit2/vmg/commit-leak
Vicent Marti [Thu, 17 Dec 2015 09:29:58 +0000 (10:29 +0100)]
Merge pull request #3551 from libgit2/vmg/commit-leak

commit: Fix memory leak in test suite

8 years agocommit: Fix memory leak in test suite
Vicent Marti [Thu, 17 Dec 2015 09:13:04 +0000 (10:13 +0100)]
commit: Fix memory leak in test suite

8 years agoMerge pull request #3550 from libgit2/vmg/index-fill-2
Vicent Marti [Thu, 17 Dec 2015 09:09:02 +0000 (10:09 +0100)]
Merge pull request #3550 from libgit2/vmg/index-fill-2

Index fill: Small fixups

8 years agoMerge pull request #3548 from tepas/patch-1
Carlos Martín Nieto [Wed, 16 Dec 2015 20:58:47 +0000 (21:58 +0100)]
Merge pull request #3548 from tepas/patch-1

fix git_blob_create_fromchunks documentation

8 years agoindex: Also size-hint the hash table
Vicent Marti [Wed, 16 Dec 2015 18:36:50 +0000 (19:36 +0100)]
index: Also size-hint the hash table

Note that we're not checking whether the resize succeeds; in OOM cases,
we let it run with a "small" vector and hash table and see if by chance
we can grow it dynamically as we insert the new entries. Nothing to
lose really.

8 years agoindex: Preallocate the entries vector with size hint
Vicent Marti [Wed, 16 Dec 2015 16:00:25 +0000 (17:00 +0100)]
index: Preallocate the entries vector with size hint

8 years agoindex: Adjust namemask & mode when filling
Vicent Marti [Wed, 16 Dec 2015 15:53:06 +0000 (16:53 +0100)]
index: Adjust namemask & mode when filling

8 years agoMerge pull request #3549 from libgit2/vmg/index-fill
Carlos Martín Nieto [Wed, 16 Dec 2015 14:18:42 +0000 (15:18 +0100)]
Merge pull request #3549 from libgit2/vmg/index-fill

merge: Use `git_index__fill` to populate the index

8 years agomerge: Use `git_index__fill` to populate the index
Vicent Marti [Wed, 16 Dec 2015 11:30:52 +0000 (12:30 +0100)]
merge: Use `git_index__fill` to populate the index

Instead of calling `git_index_add` in a loop, use the new
`git_index_fill` internal API to fill the index with the initial staged
entries.

The new `fill` helper assumes that all the entries will be unique and
valid, so it can append them at the end of the entries vector and only
sort it once at the end. It performs no validation checks.

This prevents the quadratic behavior caused by having to sort the
entries list once after every insertion.

8 years agofix git_blob_create_fromchunks documentation
tepas [Tue, 15 Dec 2015 22:25:18 +0000 (09:25 +1100)]
fix git_blob_create_fromchunks documentation

putting `0.` at the start of the line turns it into a numbered list.

8 years agoFix a couple function signatures
Thomas Edvalson [Tue, 15 Dec 2015 00:21:09 +0000 (19:21 -0500)]
Fix a couple function signatures

8 years agoMerge pull request #3528 from chescock/Passthrough-from-credential-callback
Edward Thomson [Mon, 14 Dec 2015 19:54:02 +0000 (13:54 -0600)]
Merge pull request #3528 from chescock/Passthrough-from-credential-callback

Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.

8 years agoMerge pull request #3521 from pks-t/blame-line-overflow
Edward Thomson [Mon, 14 Dec 2015 19:53:26 +0000 (13:53 -0600)]
Merge pull request #3521 from pks-t/blame-line-overflow

Line count overflow in git_blame_hunk and git_blame__entry

8 years agoMerge pull request #3522 from pks-t/email-format-commit-message
Carlos Martín Nieto [Thu, 10 Dec 2015 11:14:09 +0000 (12:14 +0100)]
Merge pull request #3522 from pks-t/email-format-commit-message

diff: include commit message when formatting patch

8 years agoMerge pull request #3538 from pks-t/pks/index-memory-leak
Carlos Martín Nieto [Thu, 10 Dec 2015 10:57:44 +0000 (11:57 +0100)]
Merge pull request #3538 from pks-t/pks/index-memory-leak

index: always queue `remove_entry` for removal

8 years agoMerge pull request #3542 from libgit2/cmn/reset-dir-file
Carlos Martín Nieto [Wed, 9 Dec 2015 19:56:04 +0000 (20:56 +0100)]
Merge pull request #3542 from libgit2/cmn/reset-dir-file

reset: perform the checkout before moving HEAD or the index

8 years agoreset: perform the checkout before moving HEAD or the index
Carlos Martín Nieto [Wed, 9 Dec 2015 18:16:11 +0000 (19:16 +0100)]
reset: perform the checkout before moving HEAD or the index

This keeps the state of the workdir the same as one from HEAD, removing
a source of possible confusion when calculating the work that is to be
done.

8 years agoCHANGELOG: add some things we missed
Carlos Martín Nieto [Wed, 9 Dec 2015 12:57:15 +0000 (13:57 +0100)]
CHANGELOG: add some things we missed

8 years agoMerge pull request #3539 from libgit2/typedef-submodule-cb
Carlos Martín Nieto [Tue, 8 Dec 2015 20:11:58 +0000 (21:11 +0100)]
Merge pull request #3539 from libgit2/typedef-submodule-cb

Use a typedef for the submodule_foreach callback.

8 years agoMerge pull request #3537 from libgit2/cmn/tree-is-sorted
Edward Thomson [Tue, 8 Dec 2015 18:12:27 +0000 (13:12 -0500)]
Merge pull request #3537 from libgit2/cmn/tree-is-sorted

tree: mark a tree as already sorted

8 years agoPlay nice with the docs.
joshaber [Tue, 8 Dec 2015 16:58:19 +0000 (11:58 -0500)]
Play nice with the docs.

8 years agoUse a typedef for the submodule_foreach callback.
joshaber [Tue, 8 Dec 2015 16:34:00 +0000 (11:34 -0500)]
Use a typedef for the submodule_foreach callback.

This fits with the style for the rest of the project, but more
importantly, makes life easier for bindings authors who auto-generate
code.

8 years agoindex: always queue `remove_entry` for removal
Patrick Steinhardt [Tue, 8 Dec 2015 15:00:35 +0000 (16:00 +0100)]
index: always queue `remove_entry` for removal

When replacing an index with a new one, we need to iterate
through all index entries in order to determine which entries are
equal. When it is not possible to re-use old entries for the new
index, we move it into a list of entries that are to be removed
and thus free'd.

When we encounter a non-zero error code, though, we skip adding
the current index entry to the remove-queue. `INSERT_MAP_EX`,
which is the function last run before adding to the remove-queue,
may return a positive non-zero code that indicates what exactly
happened while inserting the element. In this case we skip adding
the entry to the remove-queue but still continue the current
operation, leading to a leak of the current entry.

Fix this by checking for a negative return value instead of a
non-zero one when we want to add the current index entry to the
remove-queue.

8 years agotree: mark a tree as already sorted
Carlos Martín Nieto [Sun, 6 Dec 2015 21:51:00 +0000 (22:51 +0100)]
tree: mark a tree as already sorted

The trees are sorted on-disk, so we don't have to go over them
again. This cuts almost a fifth of time spent parsing trees.

8 years agoMerge pull request #3526 from sschuberth/cmake-number-compare
Carlos Martín Nieto [Sun, 6 Dec 2015 17:11:54 +0000 (18:11 +0100)]
Merge pull request #3526 from sschuberth/cmake-number-compare

CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string

8 years agoMerge pull request #3529 from mgorny/fix-checkout-test-umask
Carlos Martín Nieto [Sun, 6 Dec 2015 17:11:37 +0000 (18:11 +0100)]
Merge pull request #3529 from mgorny/fix-checkout-test-umask

checkout test: Apply umask to file-mode test as well

8 years agoMerge pull request #3530 from libgit2/cmn/parse-mode
Edward Thomson [Thu, 3 Dec 2015 22:42:52 +0000 (17:42 -0500)]
Merge pull request #3530 from libgit2/cmn/parse-mode

tree: use a specialised mode parse function

8 years agoMerge pull request #3534 from ethomson/index_canonicalize_fix
Carlos Martín Nieto [Thu, 3 Dec 2015 22:37:37 +0000 (23:37 +0100)]
Merge pull request #3534 from ethomson/index_canonicalize_fix

index: canonicalize inserted paths safely

8 years agoindex: canonicalize inserted paths safely
Edward Thomson [Thu, 3 Dec 2015 21:27:15 +0000 (16:27 -0500)]
index: canonicalize inserted paths safely

When adding to the index, we look to see if a portion of the given
path matches a portion of a path in the index.  If so, we will use
the existing path information.  For example, when adding `foo/bar.c`,
if there is an index entry to `FOO/other` and the filesystem is case
insensitive, then we will put `bar.c` into the existing tree instead
of creating a new one with a different case.

Use `strncmp` to do that instead of `memcmp`.  When we `bsearch`
into the index, we locate the position where the new entry would
go.  The index entry at that position does not necessarily have
a relation to the entry we're adding, so we cannot make assumptions
and use `memcmp`.  Instead, compare them as strings.

When canonicalizing paths, we look for the first index entry that
matches a given substring.

8 years agotree: use a specialised mode parse function
Carlos Martín Nieto [Wed, 2 Dec 2015 17:56:31 +0000 (18:56 +0100)]
tree: use a specialised mode parse function

Instead of going out to strtol, which is made to parse generic numbers,
copy a parse function from git which is specialised for file modes.

8 years agoCMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string
Sebastian Schuberth [Wed, 7 Oct 2015 08:31:07 +0000 (10:31 +0200)]
CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string

8 years agocheckout test: Apply umask to file-mode test as well
Michał Górny [Tue, 1 Dec 2015 19:41:23 +0000 (20:41 +0100)]
checkout test: Apply umask to file-mode test as well

Fix the file-mode test to expect system umask being applied to the
created file as well (it is currently applied to the directory only).
This fixes the test on systems where umask != 022.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
8 years agoTreat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.
Chris Hescock [Fri, 20 Nov 2015 16:26:26 +0000 (11:26 -0500)]
Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.

8 years agoMerge pull request #3527 from pks-t/pks/tree-entry-memleak
Edward Thomson [Tue, 1 Dec 2015 13:45:55 +0000 (08:45 -0500)]
Merge pull request #3527 from pks-t/pks/tree-entry-memleak

tree: mark cloned tree entries as un-pooled

8 years agotree: mark cloned tree entries as un-pooled
Patrick Steinhardt [Tue, 1 Dec 2015 13:19:29 +0000 (14:19 +0100)]
tree: mark cloned tree entries as un-pooled

When duplicating a `struct git_tree_entry` with
`git_tree_entry_dup` the resulting structure is not allocated
inside a memory pool. As we do a 1:1 copy of the original struct,
though, we also copy the `pooled` field, which is set to `true`
for pooled entries. This results in a huge memory leak as we
never free tree entries that were duplicated from a pooled
tree entry.

Fix this by marking the newly duplicated entry as un-pooled.

8 years agodiff: include commit message when formatting patch
Patrick Steinhardt [Tue, 24 Nov 2015 12:43:43 +0000 (13:43 +0100)]
diff: include commit message when formatting patch

When formatting a patch as email we do not include the commit's
message in the formatted patch output. Implement this and add a
test that verifies behavior.

8 years agocommit: introduce `git_commit_body`
Patrick Steinhardt [Tue, 1 Dec 2015 09:03:56 +0000 (10:03 +0100)]
commit: introduce `git_commit_body`

It is already possible to get a commit's summary with the
`git_commit_summary` function. It is not possible to get the
remaining part of the commit message, that is the commit
message's body.

Fix this by introducing a new function `git_commit_body`.

8 years agoblame: use size_t for line counts in git_blame__entry
Patrick Steinhardt [Tue, 24 Nov 2015 09:52:17 +0000 (10:52 +0100)]
blame: use size_t for line counts in git_blame__entry

The `git_blame__entry` struct keeps track of line counts with
`int` fields. Since `int` is only guaranteed to be at least 16
bits we may overflow on certain platforms when line counts exceed
2^15.

Fix this by instead storing line counts in `size_t`.

8 years agoblame: use size_t for line counts in git_blame_hunk
Patrick Steinhardt [Tue, 24 Nov 2015 09:18:58 +0000 (10:18 +0100)]
blame: use size_t for line counts in git_blame_hunk

It is not unreasonable to have versioned files with a line count
exceeding 2^16. Upon blaming such files we fail to correctly keep
track of the lines as `git_blame_hunk` stores them in `uint16_t`
fields.

Fix this by converting the line fields of `git_blame_hunk` to
`size_t`. Add test to verify behavior.

8 years agoMerge pull request #3508 from libgit2/cmn/tree-parse-speed
Edward Thomson [Tue, 1 Dec 2015 01:53:54 +0000 (20:53 -0500)]
Merge pull request #3508 from libgit2/cmn/tree-parse-speed

Improvements to tree parsing speed

8 years agoMerge pull request #3525 from pks-t/pks/fix-nested-struct-warning
Carlos Martín Nieto [Mon, 30 Nov 2015 19:41:54 +0000 (20:41 +0100)]
Merge pull request #3525 from pks-t/pks/fix-nested-struct-warning

Compiler warning fixes

8 years agoobject: remove unused constant OBJECT_BASE_SIZE
Patrick Steinhardt [Mon, 30 Nov 2015 17:05:27 +0000 (18:05 +0100)]
object: remove unused constant OBJECT_BASE_SIZE

8 years agotests: fix warning for nested struct initialization
Patrick Steinhardt [Mon, 30 Nov 2015 16:40:49 +0000 (17:40 +0100)]
tests: fix warning for nested struct initialization

8 years agotree: ensure the entry filename fits in 16 bits
Carlos Martín Nieto [Mon, 30 Nov 2015 16:32:18 +0000 (17:32 +0100)]
tree: ensure the entry filename fits in 16 bits

Return an error in case the length is too big. Also take this
opportunity to have a single allocating function for the size and
overflow logic.

8 years agoMerge pull request #3513 from ethomson/merge_recursive
Carlos Martín Nieto [Mon, 30 Nov 2015 03:49:31 +0000 (04:49 +0100)]
Merge pull request #3513 from ethomson/merge_recursive

Recursive Merge

8 years agotree: make path len uint16_t and avoid holes
Carlos Martín Nieto [Sat, 28 Nov 2015 18:18:29 +0000 (19:18 +0100)]
tree: make path len uint16_t and avoid holes

This reduces the size of the struct from 32 to 26 bytes, and leaves a
single padding byte at the end of the struct (which comes from the
zero-length array).

8 years agotree: calculate the filename length once
Carlos Martín Nieto [Sat, 14 Nov 2015 23:44:02 +0000 (00:44 +0100)]
tree: calculate the filename length once

We already know the size due to the `memchr()` so use that information
instead of calling `strlen()` on it.