Commit Graph

1811 Commits

Author SHA1 Message Date
Dirkjan Bussink
fa72d6daf8 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
2016-03-14 12:07:13 +00:00
Carlos Martín Nieto
1ddada422c Merge pull request #3636 from nerdishbynature/fix-non-modular-header-in-module
Don't include inttypes if compiling for Mac/iOS
2016-03-11 16:31:32 +01:00
Piet Brauer
0ac4a5ded4 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.
2016-03-11 10:33:37 +08:00
Vicent Marti
c68044a879 Merge pull request #3656 from ethomson/exists_prefixes
Introduce `git_odb_expand_ids`
2016-03-08 21:17:38 +01:00
Edward Thomson
62484f52d1 git_odb_expand_ids: accept git_odb_expand_id array
Take (and write to) an array of a struct, `git_odb_expand_id`.
2016-03-08 14:57:20 -05:00
Edward Thomson
4b1f0f79ac git_odb_expand_ids: rename func, return the type 2016-03-08 11:44:21 -05:00
Carlos Martín Nieto
47cb42da5a 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.
2016-03-08 13:11:49 +01:00
Edward Thomson
6c04269c8f 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.
2016-03-07 16:10:25 -05:00
Carlos Martín Nieto
1e8255a39b Bump version to 0.24.0 2016-03-03 20:20:43 +01:00
Edward Thomson
22a19f5b57 git_libgit2_opts: introduce GIT_OPT_ENABLE_STRICT_OBJECT_CREATION 2016-02-28 12:38:39 -05:00
Edward Thomson
0d9a7498c5 Merge pull request #3628 from pks-t/pks/coverity-fixes
Coverity fixes
2016-02-25 12:09:49 -05:00
Edward Thomson
cd59e0c0c7 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.
2016-02-23 13:08:58 -05:00
Patrick Steinhardt
0f1e2d2066 index: fix contradicting comparison
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.
2016-02-23 12:07:14 +01:00
Edward Thomson
5bc93eaea0 git_libgit2_opts: document GIT_OPT_SET_USER_AGENT 2016-02-22 22:26:01 -05:00
Carlos Martín Nieto
88ab3be6f5 Fix a few checkout -> rebase typos 2016-02-22 15:41:01 +01:00
Carlos Martín Nieto
78e16c3442 Merge pull request #3597 from ethomson/filter_registration
Filter registration
2016-02-19 13:06:51 +01:00
Carlos Martín Nieto
eadd0f05f6 commit: expose the different kinds of errors
We should be checking whether the object we're looking up is a commit,
and we should let the caller know whether the not-found return code
comes from a bad object type or just a missing signature.
2016-02-16 14:06:48 +01:00
Edward Thomson
f28bae0c38 rebase: persist a single in-memory index
When performing an in-memory rebase, keep a single index for the
duration, so that callers have the expected index lifecycle and
do not hold on to an index that is free'd out from under them.
2016-02-15 19:27:06 +00:00
Edward Thomson
a202e0d45b rebase: allow custom merge_options
Allow callers of rebase to specify custom merge options.  This may
allow custom conflict resolution, or failing fast when conflicts
are detected.
2016-02-11 10:49:25 -08:00
Edward Thomson
ee6673070a rebase: introduce inmemory rebasing
Introduce the ability to rebase in-memory or in a bare repository.

When `rebase_options.inmemory` is specified, the resultant `git_rebase`
session will not be persisted to disk.  Callers may still analyze
the rebase operations, resolve any conflicts against the in-memory
index and create the commits.  Neither `HEAD` nor the working
directory will be updated during this process.
2016-02-11 10:48:48 -08:00
Edward Thomson
82abd40d80 filter: clean up documentation around custom filters 2016-02-09 21:47:51 -08:00
Vicent Marti
488e2b8505 Merge pull request #3599 from libgit2/gpgsign
Introduce git_commit_extract_signature
2016-02-09 16:26:58 +01:00
Carlos Martín Nieto
a65afb757e 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.
2016-02-09 15:58:16 +01:00
Edward Thomson
b00c959f45 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 5e44d9bcb6.
2016-02-08 17:56:41 -08:00
Edward Thomson
45165b1208 Merge pull request #3584 from jbreeden/export_fn
Export git_stash_apply_init_options
2016-02-04 16:43:23 -08:00
Ephemera
804bcd6b95 Fix typo 2016-02-05 01:59:07 +09:00
Nicolas Vanheuverzwijn
1087e6be88 Fix a typo in documentation 2016-02-03 17:27:04 -05:00
jbreeden
d02720d8a6 Export git_stash_apply_init_options 2016-01-23 17:13:25 -08:00
Edward Thomson
869320a85d Merge pull request #3546 from Cruel/master
Fix a couple function signatures
2015-12-26 16:55:29 -06:00
tepas
cf339ede0a fix git_blob_create_fromchunks documentation
putting `0.` at the start of the line turns it into a numbered list.
2015-12-16 09:25:18 +11:00
Thomas Edvalson
95746a57c7 Fix a couple function signatures 2015-12-14 19:21:09 -05:00
Edward Thomson
30c8e26074 Merge pull request #3521 from pks-t/blame-line-overflow
Line count overflow in git_blame_hunk and git_blame__entry
2015-12-14 13:53:26 -06:00
Carlos Martín Nieto
6aa06b65cf Merge pull request #3522 from pks-t/email-format-commit-message
diff: include commit message when formatting patch
2015-12-10 12:14:09 +01:00
joshaber
ab273821ee Play nice with the docs. 2015-12-08 11:58:19 -05:00
joshaber
eda726cfb5 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.
2015-12-08 11:34:00 -05:00
Patrick Steinhardt
254e0a33ee 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.
2015-12-01 10:12:53 +01:00
Patrick Steinhardt
7f8fe1d45e 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`.
2015-12-01 10:07:00 +01:00
Patrick Steinhardt
cb1cb24ca9 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.
2015-12-01 09:02:47 +01:00
Edward Thomson
5b9c63c3f6 recursive merge: add a recursion limit 2015-11-25 16:25:47 -05:00
Edward Thomson
86c8d02c07 merge: add simple recursive test
Add a simple recursive test - where multiple ancestors exist and
creating a virtual merge base from them would prevent a conflict.
2015-11-25 15:37:11 -05:00
Edward Thomson
fa78782f67 merge: rename git_merge_tree_flags_t -> git_merge_flags_t 2015-11-25 15:37:05 -05:00
Carlos Martín Nieto
2ea40fdaac repository: distinguish sequencer cherry-pick and revert
These are not quite like their plain counterparts and require special handling.
2015-11-20 13:19:23 -05:00
Edward Thomson
3eac1037d6 settings: allow users to set PROGRAMDATA
Allow users to set the `git_libgit2_opts` search path for the
`GIT_CONFIG_LEVEL_PROGRAMDATA`.  Convert `GIT_CONFIG_LEVEL_PROGRAMDATA`
to `GIT_SYSDIR_PROGRAMDATA` for setting the configuration.
2015-11-16 23:31:19 -05:00
Carlos Martín Nieto
75a0ccf52f Merge pull request #3170 from CmdrMoozy/nsec_fix
git_index_entry__init_from_stat: set nsec fields in entry stats
2015-11-12 19:53:09 +01:00
Carlos Martín Nieto
de870533e0 settings: add a setter for a custom user-agent 2015-11-12 17:18:42 +01:00
Carlos Martín Nieto
7fafde6325 stream: allow registering a user-provided TLS constructor
This allows the application to use their own TLS stream, regardless of
the capabilities of libgit2 itself.
2015-11-03 08:10:29 -08:00
Jason Haslam
3138ad9366 Add diff progress callback. 2015-11-02 16:33:58 -05:00
Leo Yang
bf28da4718 Fix build for custom transport users
We should explicitly include the declaration of git_strarray
from "include/git2/sys/transport.h"
2015-10-30 14:17:11 -04:00
Vicent Marti
a1f5d691a2 merge: Implement GIT_MERGE_TREE_SKIP_REUC 2015-10-27 22:44:26 +01:00
Edward Thomson
821131fdae Merge pull request #3477 from linquize/inttypes.h
inttypes.h is built-in header file since MSVC 2013
2015-10-23 10:13:14 -05:00