|
819492c1
|
2020-09-18T10:34:40
|
|
refs: fix potential free of uninitialized variable
The `signature` variable in `git_reference_rename` isn't initialized and
neither does `git_reference__log_signature` always do. So if the latter
function fails, we'll call `git_signature_free` on this unininitialized
variable.
Fix the issue by initializing the pointer with `NULL`.
|
|
9e81711b
|
2020-09-18T10:31:50
|
|
Merge pull request #5632 from csware/winhttp_typo
Fix typo: Make ifndef macroname the same as the define name
|
|
ae99e697
|
2020-09-17T11:19:49
|
|
Merge pull request #5619 from ddevault/diffstat-segfault
diff stats: fix segfaults with new files
|
|
ec26b16d
|
2020-08-29T10:44:40
|
|
diff stats: fix segfaults with new files
|
|
298b01ab
|
2020-09-15T09:26:08
|
|
Merge pull request #5633 from csware/winhttp1.3
WinHTTP: Try to use TLS1.3
|
|
d65edcdc
|
2020-09-15T09:23:00
|
|
Merge pull request #5628 from interkosmos/master
Fixed includes for FreeBSD
|
|
6887e9db
|
2020-09-14T15:54:00
|
|
Removed FreeBSD-related macros.
|
|
797535b6
|
2020-09-12T00:14:41
|
|
WinHTTP: Try to use TLS1.3
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
621e501c
|
2020-09-10T10:32:02
|
|
Fix typo: Make ifndef macroname the same as the define name
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
e937a2aa
|
2020-09-09T19:08:20
|
|
Fixed includes for FreeBSD.
|
|
1e987525
|
2020-09-08T17:25:06
|
|
Merge pull request #5624 from csware/http-upgrade-header
Don't fail if a HTTP server announces he supports a protocol upgrade
|
|
2dea3eb4
|
2020-09-08T13:03:07
|
|
Don't fail if a HTTP server announces he supports a protocol upgrade
cf. RFC7230 section 6.7, an Upgrade header in a normal response merely informs the client that the server supports upgrading to other protocols, and the client can ask for such an upgrade in a later request. The server requiring an upgrade is via the 426 Upgrade Required response code, not the mere presence of the Upgrade response header.
(closes issue #5573)
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
f29e6dde
|
2020-09-01T09:58:13
|
|
Merge pull request #5621 from kim/null-safe-git_net_url_is_default_port
Return false instead of segfaulting when checking for default port
|
|
7e1f0b22
|
2020-08-31T21:54:17
|
|
Return false instead of segfaulting when checking for default port
`default_port_for_scheme` returns NULL if the scheme is not one of the
builtin ones. This may cause a segmentation fault if a custom transport
URL happens to contain a port number, and this code path is triggered
(e.g. by setting git_fetch_options->update_fetchhead to 1).
|
|
a5eb7e02
|
2020-08-31T12:52:48
|
|
Merge pull request #5612 from mmuman/haiku
deps: ntlmclient: fix htonll for Haiku
|
|
8e3f8823
|
2020-08-31T12:45:11
|
|
Merge pull request #5615 from libgit2/pks/azure-remove-docjob
azure: Remove job generating documentation
|
|
931bd3b8
|
2020-08-28T12:30:35
|
|
Merge pull request #5617 from muhkuh-sys/master
Fix crash in git_describe_commit when opts are NULL.
|
|
d10c846e
|
2020-08-27T21:47:48
|
|
Fix crash in git_describe_commit when opts are NULL.
The argument "opts" can be NULL, which selects default options. Do not access
"opts" directly but only the normalized copy.
|
|
7851a165
|
2020-08-24T12:31:08
|
|
azure: Remove job generating documentation
With the recent addition of GitHub Actions to our CI infrastructure, we
now have two jobs which generate documentation: once in GHA, once in
Azure. Naturally, as they both want to update the same branch, they race
against each other and one of both jobs will fail.
Fix this by removing the documentation job from Azure.
|
|
da3288de
|
2020-08-24T11:20:50
|
|
Merge pull request #5600 from andrewhickman/fix-double-free
Fix `git_mwindow_scan_recently_used` spuriously returning true
|
|
24eacab9
|
2020-08-24T11:00:20
|
|
Merge pull request #5599 from libgit2/ethomson/zlib
zstream: handle Z_BUF_ERROR appropriately in get_output_chunk
|
|
8a24ee8a
|
2020-08-24T10:28:02
|
|
Merge pull request #5610 from SirWindfield/patch-1
docs: fix typo
|
|
92913621
|
2020-08-21T23:00:59
|
|
deps: ntlmclient: #error out on unknown platforms
We explicitly pass win32 & macOS, although some old version might not
have it.
|
|
49ce5e29
|
2020-08-21T17:34:57
|
|
deps: ntlmclient: fix htonll for Haiku
Use B_HOST_TO_BENDIAN_INT64 for that.
|
|
e46ef5ee
|
2020-08-18T14:58:21
|
|
docs: fix typo
|
|
04d59466
|
2020-08-05T22:04:15
|
|
Preserve behaviour of `git_mwindow_scan_recently_used` with `*out_window` set
|
|
8ea9187a
|
2020-08-05T20:22:55
|
|
Fix `git_mwindow_scan_recently_used` spuriously returning true
|
|
4d4befac
|
2020-08-05T10:07:23
|
|
pack: check pack_window_open return
|
|
9bb61bad
|
2020-08-05T09:42:52
|
|
zstream: handle Z_BUF_ERROR appropriately in get_output_chunk
Our processing loop in git_zstream_get_output_chunk does not handle
`Z_BUF_ERROR` appropriately at the end of a compressed window.
From the zlib manual, inflate will return:
> Z_BUF_ERROR if no progress was possible or if there was not enough
> room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR
> is not fatal, and inflate() can be called again with more input and
> more output space to continue decompressing.
In our loop, we were waiting until we got the expected size, then
ensuring that we were at `Z_STREAM_END`. We are not guaranteed to be,
since zlib may be in the `Z_BUF_ERROR` state where it has consumed a
full window's worth of data, but it doesn't know that it's really at the
end of the stream. There _could_ be more compressed data, but it
doesn't _know_ that there's not until we make a subsequent call.
We can change the loop to look for the end of stream instead of our
expected size. This allows us to call inflate one last time when we are
at the end of a window (and in the `Z_BUF_ERROR` state), allowing it to
recognize the end of the stream, and move from the `Z_BUF_ERROR` state
to the `Z_STREAM_END` state.
If we do this, we need another exit condition: when `bytes == 0`, then
no progress could be made and we should stop trying to inflate. This
will be an error case, caught by the size and/or end-of-stream test.
|
|
c71321a0
|
2020-08-03T11:53:03
|
|
Merge pull request #5596 from libgit2/ethomson/sanitizer_ci
sanitizer ci: skip negotiate tests
|
|
6973c570
|
2020-08-03T11:03:19
|
|
sanitizer ci: skip negotiate tests
We don't build with SPNEGO enabled on our focal-based sanitizer builds,
so we need to disable the negotiate tests.
|
|
11a62973
|
2020-08-03T10:01:26
|
|
Merge pull request #5569 from lhchavez/ci-sanitizers
Add CI support for Memory and UndefinedBehavior Sanitizers
|
|
c5d41d46
|
2020-08-03T09:55:22
|
|
Merge pull request #5563 from pks-t/pks/worktree-heads
Access HEAD via the refdb backends
|
|
52ccbc5d
|
2020-08-03T09:52:30
|
|
Merge pull request #5582 from libgit2/pks-config-map-optimization
config_entries: Avoid excessive map operations
|
|
f2400a9c
|
2020-07-13T20:56:08
|
|
config_entries: Avoid excessive map operations
When appending config entries, we currently always first get the
currently existing map entry and then afterwards update the map to
contain the current config value. In the common scenario where keys
aren't being overridden, this is the best we can do. But in case a key
gets set multiple times, then we'll also perform these two map
operations. In extreme cases, hashing the map keys will thus start to
dominate performance.
Let's optimize the pattern by using a separately allocated map entry.
Currently, we always put the current list entry into the map and update
it to get any overridden multivar. As these list entries are also used
to iterate config entries, we cannot update them in-place in the map and
are thus forced to always set the map to contain the new entry. But with
a separately allocated map entry, we can now create one once per config
key and insert it into the map. Whenever appending a new config value
with the same key, we can now just update the map entry in-place instead
of having to replace the map entry completely.
This reduces calls to the hashing function by half and trades the
improved runtime for one more allocation per unique config key. Given
that the refactoring arguably improves code readability by splitting
concerns of the `config_entry_list` type and not having to track it in
two different structures, this alone would already be reason enough to
take the trade.
Given a pathological case of a gitconfig with 100.000 repeated keys and
a section of length 10.000 characters, this reduces runtime by half from
approximately 14 seconds to 7 seconds as expected.
|
|
a83fd510
|
2020-07-12T21:26:59
|
|
Merge pull request #5396 from lhchavez/mwindow-file-limit
mwindow: set limit on number of open files
|
|
92d42eb3
|
2020-07-12T09:53:10
|
|
Minor nits and style formatting
|
|
ce4cb073
|
2020-07-12T18:19:21
|
|
tests: verify renaming branch really updates worktree HEAD
In case where a branch is getting renamed, all HEADs of the main
repository and of its worktrees that point to the old branch need to get
updated to point to the new branch. We already do so and have a test for
this, but the test only verifies that we're able to lookup the updated
HEAD, not what it contains.
Let's make the test more specific by verifying the updated HEAD also has
the correct updated symbolic target.
|
|
5434f9a3
|
2020-06-17T14:57:13
|
|
refs: remove function to read HEAD directly
With the last user of `git_reference__read_head` gone, let's remove it
as it's been reading references without consulting the refdb backends.
|
|
65895410
|
2020-06-17T14:56:36
|
|
repository: retrieve worktree HEAD via refdb
The function `git_repository_head_for_worktree` currently uses
`git_reference__read_head` to directly read a given worktree's HEAD from
the filesystem. This is broken in case the repository uses a different
refdb implementation than the filesystem-based one, so let's instead
open the worktree as a real repository and use `git_reference_lookup`.
This also fixes the case where the worktree's HEAD is not a symref, but
a detached HEAD, which would have resulted in an error previously.
|
|
d1f210fc
|
2020-06-17T15:09:49
|
|
repository: remove function to iterate over HEADs
The function `git_repository_foreach_head` is broken, as it directly
interacts with the on-disk representation of the reference database,
thus assuming that no other refdb is used for the given repository. As
this is an internal function only and all users have been replaced,
let's remove this function.
|
|
ac5fbe31
|
2020-06-17T14:43:27
|
|
branch: determine whether a branch is checked out via refdb
We currently determine whether a branch is checked out via
`git_repository_foreach_head`. As this function reads references
directly from the disk, it breaks our refdb abstraction in case the
repository uses a different reference backend implementation than the
filesystem-based one. So let's use `git_repository_foreach_worktree`
instead -- while it's less efficient, it is at least correct in all
corner cases.
|
|
7216b048
|
2020-06-17T14:23:15
|
|
refs: update HEAD references via refdb
When renaming a reference, we need to iterate over every HEAD and
potentially update it in case it is a symbolic reference pointing to the
previous name of the renamed reference. Most importantly, this doesn't
only include HEADs from the repo we're renaming the reference in, but we
also need to iterate over HEADs from linked worktrees.
In order to update the HEADs, we directly read them from the worktree's
gitdir and thus assume that both repository and worktrees use the
filesystem-based reference backend. But this breaks as soon as one got a
repository with a different refdb and breaks our own abstractions. So
let's instead update HEAD references via the refdb by first opening each
worktree as a repository and then using the usual functions to read and
update HEADs. This is a lot less efficient than the current code, but
it's not like we can really help this: going via the refdb is mandatory.
|
|
2fcb4f28
|
2020-06-17T14:09:04
|
|
repository: introduce new function to iterate over all worktrees
Given a Git repository, it's non-trivial to iterate over all worktrees
that are associated with it, including the "main" repository. This
commit adds a new internal function `git_repository_foreach_worktree`
that does this for us.
|
|
26b9e489
|
2020-07-12T17:04:29
|
|
Merge pull request #5570 from libgit2/pks/refdb-refactorings
refdb: a set of preliminary refactorings for the reftable backend
|
|
34987447
|
2020-06-30T10:13:26
|
|
refdb: avoid unlimited spinning in case of symref cycles
To determine whether another reflog entry needs to be written for HEAD
on a reference update, we need to see whether HEAD directly or
indirectly points to the reference we're updating. The resolve logic is
currently completely unbounded except an error occurs, which effectively
means that we'd be spinning forever in case we have a symref loop in the
repository refdb.
Let's fix the issue by using `git_refdb_resolve` instead, which is
always bounded.
|
|
b895547c
|
2020-06-30T09:35:21
|
|
refs: replace reimplementation of reference resolver
The refs code currently has a second implementation that resolves
references in order to find any final symbolic reference pointing to a
nonexistent target branch. As we've just extended `git_refdb_resolve` to
also return such references, let's use that one instead in order to
reduce code duplication.
|
|
cf7dd05b
|
2020-06-30T13:26:05
|
|
refdb: return resolved symbolic refs pointing to nonexistent refs
In some cases, resolving references requires us to also know about the
final symbolic reference that's pointing to a nonexistent branch, e.g.
in an empty repository where the main branch is yet unborn but HEAD
already points to it. Right now, the resolving logic is thus split up
into two, where one is the new refdb implementation and the second one
is an ad-hoc implementation inside "refs.c".
Let's extend `git_refdb_resolve` to also return such final dangling
references pointing to nonexistent branches so we can deduplicate the
resolving logic.
|
|
c54f40e4
|
2020-06-30T09:28:12
|
|
refs: move resolving of references into the refdb
Resolving of symbolic references is currently implemented inside the
"refs" layer. As a result, it's hard to call this function from
low-level parts that only have a refdb available, but no repository, as
the "refs" layer always operates on the repository-level. So let's move
the function into the generic "refdb" implementation to lift this
restriction.
|
|
ae30009e
|
2020-07-12T16:01:15
|
|
Merge pull request #5547 from pks-t/pks/cmake-modernization-pt2
CMake modernization pt2
|
|
9703d26f
|
2020-06-29T12:22:27
|
|
tests: reflog: remove unused signature
There's two tests that create a commit signature, but never make any use
of it. Let's remove these to avoid any confusion.
|
|
1f39593b
|
2020-06-30T08:53:59
|
|
refdb: extract function to check whether to append HEAD to the reflog
The logic to determine whether a reflog entry should be for the HEAD
reference is non-trivial. Currently, the only user of this is the
filesystem-based refdb, but with the advent of the reftable refdb we're
going to add a second user that's interested in having the same
behaviour.
Let's pull out a new function that checks whether a given reference
should cause a entry to be written to the HEAD reflog as a preparatory
step.
|
|
e02478b1
|
2020-06-05T08:17:03
|
|
refdb: extract function to check whether a reflog should be written
The logic to determine whether a reflog should be written is
non-trivial. Currently, the only user of this is the filesystem-based
refdb, but with the advent of the reftable refdb we're going to add a
second user that's interested in having the same behaviour.
Let's pull out a new function that checks whether a given reference
should cause a reflog to be written as a preparatory step.
|
|
9bc6e655
|
2020-06-05T11:37:30
|
|
cmake: remove CheckPrototypeDefinition module
In the past, we've imported the CheckPrototypeDefinition into our own
module directory as it wasn't yet available in all supported CMake
versions. Now that we require at least CMake v3.5, we don't need to
bundle it anymore as it's included with the distribution already.
Let's drop the included modules and always use upstream's version.
|
|
4218403e
|
2020-06-05T10:49:09
|
|
cmake: use target-specific compile definitions
We set up some compile definitions as part of our src/CMakeLists.txt.
While the definitions are global, we really only need them as part of
the git2internal target which compiles all the objects. Let's thus use
`target_compile_definitions` instead of `add_definitions`.
|
|
53911edd
|
2020-06-05T10:24:30
|
|
cmake: use git2internal target to populate sources
Modern CMake is usually target-driven in that a target is first defined
and then the likes of `target_sources`, `target_include_directories`
etc. are used to further populate the target. We still use old-style
CMake, where we first set up a set of variables and then populate the
target in a single call.
Let's migrate to modern CMake usage by starting to populate the sources
of our git2internal target piece-by-piece. While this is a small step,
it allows us to convert to target-based build instructions
piece-by-piece.
|
|
19eb1e4b
|
2020-06-05T10:07:33
|
|
cmake: specify project version
We currently do not set up a project version within CMake, meaning that
it can't be use by other projects including libgit2 as a sub-project and
also not by other tools like IDEs.
This commit changes this to always set up a project version, but instead
of extracting it from the "version.h" header we now set it up directly.
This is mostly to avoid mis-use of the previous `LIBGIT2_VERSION`
variables, as we should now always use the `libgit2_VERSION` ones that
are set up by CMake if one provides the "VERSION" keyword to the
`project()` call. While this is one more moving target we need to adjust
on releases, this commit also adjusts our release script to verify that
the project version was incremented as expected.
|
|
6a917c04
|
2020-06-28T15:51:43
|
|
Add CI support for Memory and UndefinedBehavior Sanitizers
This change adds two new build targets: MSan and UBSan. This is because
even though OSS-Fuzz is great and adds a lot of coverage, it only does
that for the fuzz targets, so the rest of the codebase is not
necessarily run with the Sanitizers ever :( So this change makes sure
that MSan/UBSan warnings don't make it into the codebase.
As part of this change, the Ubuntu focal container is introduced. It
builds mbedTLS and libssh2 as debug libraries into /usr/local and as
MSan-enabled libraries into /usr/local/msan. This latter part is needed
because MSan requires the binary and all its dependent libraries to be
built with MSan support so that memory allocations and deallocations are
tracked correctly to avoid false positives.
|
|
325375e3
|
2020-07-09T23:12:58
|
|
Merge pull request #5568 from lhchavez/ubsan
Make the tests run cleanly under UndefinedBehaviorSanitizer
|
|
2ffa426e
|
2020-07-09T23:02:05
|
|
Merge pull request #5567 from lhchavez/msan
Make the tests pass cleanly with MemorySanitizer
|
|
60536163
|
2020-07-09T22:56:44
|
|
Merge pull request #5561 from A-Ovchinnikov-mx/a-ovchin/windres-rc
Enable building git2.rc resource script with GCC
|
|
8720ae8a
|
2020-07-02T11:45:16
|
|
Merge pull request #5571 from lhchavez/ntlmclient-sanitizers
Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean
|
|
71000441
|
2020-06-16T18:58:07
|
|
Review: Rename the stringize macro
|
|
dc1deb3b
|
2020-07-01T15:41:38
|
|
Use __GNUC__ macro in the resource script
Fix the default LIBGIT2_FILENAME for GNU windres
|
|
5c40456b
|
2020-06-16T13:19:02
|
|
Enable building git2.rc resource script with GCC
|
|
7c964416
|
2020-06-30T05:46:47
|
|
Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean
This change makes the code pass the libgit2 tests cleanly when
MSan/UBSan are enabled. Notably:
* Changes malloc/memset combos into calloc for easier auditing.
* Makes `write_buf` return early if the buffer length is empty to avoid
arithmetic with NULL pointers (which UBSan does not like).
* Initializes a few arrays that were sometimes being read before being
written to.
|
|
3a197ea7
|
2020-06-27T12:33:32
|
|
Make the tests pass cleanly with MemorySanitizer
This change:
* Initializes a few variables that were being read before being
initialized.
* Includes https://github.com/madler/zlib/pull/393. As such,
it only works reliably with `-DUSE_BUNDLED_ZLIB=ON`.
|
|
d0656ac8
|
2020-06-27T12:15:26
|
|
Make the tests run cleanly under UndefinedBehaviorSanitizer
This change makes the tests run cleanly under
`-fsanitize=undefined,nullability` and comprises of:
* Avoids some arithmetic with NULL pointers (which UBSan does not like).
* Avoids an overflow in a shift, due to an uint8_t being implicitly
converted to a signed 32-bit signed integer after being shifted by a
32-bit signed integer.
* Avoids a unaligned read in libgit2.
* Ignores unaligned reads in the SHA1 library, since it only happens on
Intel processors, where it is _still_ undefined behavior, but the
semantics are moderately well-understood.
Of notable omission is `-fsanitize=integer`, since there are lots of
warnings in zlib and the SHA1 library which probably don't make sense to
fix and I could not figure out how to silence easily. libgit2 itself
also has ~100s of warnings which are mostly innocuous (e.g. use of enum
constants that only fit on an `uint32_t`, but there is no way to do that
in a simple fashion because the data type chosen for enumerated types is
implementation-defined), and investigating whether there are worrying
warnings would need reducing the noise significantly.
|
|
d88994da
|
2020-06-27T07:34:36
|
|
Create the repository within the test
This change moves the humongous static repository with 1025 commits into
the test file, now with a more modest 16 commits.
|
|
eab2b044
|
2020-06-26T16:10:30
|
|
Review feedback
* Change the default of the file limit to 0 (unlimited).
* Changed the heuristic to close files to be the file that contains the
least-recently-used window such that the window is the
most-recently-used in the file, and the file does not have in-use
windows.
* Parameterized the filelimit test to check for a limit of 1 and 100
open windows.
|
|
d6c62852
|
2020-06-23T09:16:05
|
|
Merge pull request #5559 from pks-t/pks/diff-print-fixups
Random fixes for diff-printing
|
|
9679df57
|
2020-02-08T20:47:24
|
|
mwindow: set limit on number of open files
There are some cases in which repositories accrue a large number of
packfiles. The existing mwindow limit applies only to the total size of
mmap'd files, not on their number. This leads to a situation in which
having lots of small packfiles could exhaust the allowed number of open
files, particularly on macOS, where the default ulimit is very low
(256).
This change adds a new configuration parameter
(GIT_OPT_SET_MWINDOW_FILE_LIMIT) that sets the maximum number of open
packfiles, with a default of 128. This is low enough so that even macOS
users should not hit it during normal use.
Based on PR #5386, originally written by @josharian.
Fixes: #2758
|
|
d43d490c
|
2020-06-17T17:51:19
|
|
Merge pull request #5419 from lhchavez/fix-git_index_add_from_buffer-docs
index: Update the documentation for git_index_add_from_buffer()
|
|
6256d023
|
2020-06-15T14:34:29
|
|
diff_print: adjust code to match current coding style
|
|
490d0c9c
|
2020-06-15T14:26:13
|
|
diff_print: return out-of-memory situation when printing binary
We currently don't check for out-of-memory situations on exiting
`format_binary` and, as a result, may return a partially filled buffer.
Fix this by checking the buffer via `git_buf_oom`.
|
|
bea5fd9f
|
2020-06-15T13:26:18
|
|
diff_print: do not call abort(3P)
Calling abort(3P) in a library is rather rude and shouldn't happen, as
we effectively prohibit any corrective actions made by the application
linking to it. We thus shouldn't call it at all, but instead use our new
`GIT_ASSERT` macros.
Remove the call to abort(3P) in case a diff delta has an unexpected type
to fix this.
|
|
0cf1f444
|
2020-06-15T13:19:44
|
|
diff_print: handle errors when printing to file
When printing the diff to a `FILE *` handle, we neither check the return
value of fputc(3P) nor the one of fwrite(3P). As a result, we'll
silently return successful even if we didn't print anything at all.
Futhermore, the arguments to fwrite(3P) are reversed: we have one item
of length `content_len`, and not `content_len` items of one byte.
Fix both issues by checking return values as well as reversing the
arguments to fwrite(3P).
|
|
d60bf002
|
2020-06-16T17:02:40
|
|
Merge pull request #5550 from libgit2/ethomson/github_actions
Introduce CI with GitHub Actions
|
|
47fb33ba
|
2020-06-07T00:39:27
|
|
Introduce CI with GitHub Actions
Add CI using GitHub Actions and GitHub Packages:
* This moves our Linux build containers into GitHub Packages; we will
identify the most recent commit that updated the docker descriptions,
and then look for a docker image in libgit2's GitHub Packages registry
for a container with the tag corresponding to that description. If
there is not one, we will build the container and then push it to
GitHub Packages.
* We no longer need to manage authentication with our own credentials or
PAT tokens. GitHub Actions provides a GITHUB_TOKEN that can publish
artifacts, packages and commits to our repository within a workflow
run.
* We will use a matrix to build our various CI steps. This allows us
to keep configuration in a single place without multiple YAML files.
|
|
74520b91
|
2020-06-13T19:38:11
|
|
Merge pull request #5552 from libgit2/pks/small-fixes
Random code cleanups and fixes
|
|
79d0e0c1
|
2020-06-12T18:21:46
|
|
Merge pull request #5553 from pks-t/pks/example-log-docfix
examples: log: fix documentation generation
|
|
4852d8da
|
2020-06-10T22:18:13
|
|
docker: don't take BASE as an argument
The xenial image depends on ubuntu:xenial; the bionic one on
ubuntu:bionic. No need for this to be a variable, that's just
additional (unnecessary) state to manage in the CI setup(s).
|
|
8b8b69a7
|
2020-06-10T22:13:25
|
|
azure pipelines: use bundled zlib
Azure Pipelines has a version of zlib hanging out on the filesystem;
avoid trying to use it as it's either 64 _or_ 32 bit, so exactly one of
our builds will fail.
|
|
96a5f38f
|
2020-06-10T07:42:52
|
|
Merge pull request #5551 from pks-t/pks/missing-declarations
Missing declarations
|
|
03c4f86c
|
2020-06-08T12:42:59
|
|
cmake: enable warnings for missing function declarations
Over time, we have accumulated quite a lot of functions with missing
prototypes, missing `static` keywords or which were completely unused.
It's easy to miss these mistakes, but luckily GCC and Clang both have
the `-Wmissing-declarations` warning. Enabling this will cause them to
emit warnings for every not-static function that doesn't have a previous
declaration. This is a very sane thing to enable, and with the preceding
commits all these new warnings have been fixed.
So let's always enable this warning so we won't introduce new instances
of them.
|
|
fd1f0940
|
2020-06-08T12:42:26
|
|
refs: add missing function declaration
The function `git_reference__is_note` is not declared anywhere. Let's
add the declaration to avoid having non-static functions without
declaration.
|
|
c6184f0c
|
2020-06-08T21:07:36
|
|
tree-wide: do not compile deprecated functions with hard deprecation
When compiling libgit2 with -DDEPRECATE_HARD, we add a preprocessor
definition `GIT_DEPRECATE_HARD` which causes the "git2/deprecated.h"
header to be empty. As a result, no function declarations are made
available to callers, but the implementations are still available to
link against. This has the problem that function declarations also
aren't visible to the implementations, meaning that the symbol's
visibility will not be set up correctly. As a result, the resulting
library may not expose those deprecated symbols at all on some platforms
and thus cause linking errors.
Fix the issue by conditionally compiling deprecated functions, only.
While it becomes impossible to link against such a library in case one
uses deprecated functions, distributors of libgit2 aren't expected to
pass -DDEPRECATE_HARD anyway. Instead, users of libgit2 should manually
define GIT_DEPRECATE_HARD to hide deprecated functions. Using "real"
hard deprecation still makes sense in the context of CI to test we don't
use deprecated symbols ourselves and in case a dependant uses libgit2 in
a vendored way and knows it won't ever use any of the deprecated symbols
anyway.
|
|
6e1efcd6
|
2020-06-08T12:46:04
|
|
tree-wide: add missing header includes
We're missing some header includes leading to missing function
prototypes. While we currently don't warn about these, we should have
their respective headers included in order to detect the case where a
function signature change results in an incompatibility.
|
|
a6c9e0b3
|
2020-06-08T12:40:47
|
|
tree-wide: mark local functions as static
We've accumulated quite some functions which are never used outside of
their respective code unit, but which are lacking the `static` keyword.
Add it to reduce their linkage scope and allow the compiler to optimize
better.
|
|
7c499b54
|
2020-06-08T12:39:09
|
|
tree-wide: remove unused functions
We have some functions which aren't used anywhere. Let's remove them to
get rid of unneeded baggage.
|
|
939cb73f
|
2020-06-08T15:28:20
|
|
examples: log: fix documentation generation
Docurium seems to be confused by our use of `/** comment */;` use in the
log example. Let's just switch it around to help Docurium get this
right.
|
|
46637b5e
|
2020-06-08T14:47:01
|
|
checkout: remove unused code for deferred removals
With commit 05f690122 (checkout: remove blocking dir when FORCEd,
2015-03-31), the last case was removde that actually queued a deferred
removal. This is now more than five years in the past and nobody
complained, so we can rest quite assured that the deferred removal is
not really needed at all.
Let's remove all related code to simplify the already complicated
checkout logic.
|
|
9e4e25b1
|
2020-06-08T12:57:48
|
|
tests: refs: modernize coding style of testcase
The coding style of the testcase refs::create::propagate_eexists is not
really up-to-date. Convert it to use a more modern coding style.
|
|
45901d3e
|
2020-06-08T12:57:16
|
|
revparse: remove superfluous tab character
|
|
c146374c
|
2020-06-08T12:54:26
|
|
revparse: detect out-of-memory cases when parsing curly brace contents
When extracting curly braces (e.g. the "upstream" part in
"HEAD@{upstream}"), we put the curly braces' contents into a `git_buf`
structure, but don't check the return value of `git_buf_putc`. So when
we run out-of-memory, we'll use a partially filled buffer without
noticing.
Let's fix this issue by checking `git_buf_putc`'s return value.
|
|
b2217552
|
2020-06-07T01:02:38
|
|
Revert .github/workflows/main.yml
|
|
c16ba496
|
2020-06-07T00:37:55
|
|
yo
|
|
d1f3933e
|
2020-06-07T00:35:19
|
|
Update main.yml
|
|
e51002ab
|
2020-06-07T00:33:18
|
|
Update main.yml
|
|
8f48cbf7
|
2020-06-07T00:30:39
|
|
Update main.yml
|