Commit Graph

16227 Commits

Author SHA1 Message Date
Edward Thomson
af1e2fa3d0 Merge pull request #7117 from pks-gitlab/pks/reftables-support
Reftables support
2026-05-06 22:02:32 +01:00
Edward Thomson
7a12070f5a Merge pull request #7121 from yonathan-ashebir/main
Adding missing includes in public header files
2026-05-06 22:01:18 +01:00
Edward Thomson
b6a9e9a994 Merge pull request #7051 from timonvo/diff-from-buffer-binary-roundtrip
diff: make `git_diff_from_buffer` diffs show binary data when printed.
2026-05-06 21:48:25 +01:00
Kevin Saul
3e5b7ed79b remote: don't create empty FETCH_HEAD file when update suppressed (#7244) 2026-05-06 17:37:41 +01:00
Edward Thomson
f687244dc2 Merge pull request #7252 from libgit2/ethomson/docs-update 2026-05-05 07:05:24 +01:00
Edward Thomson
95bacb75a1 docs: update README to remove Coverity Scan badge (#7251)
Removed Coverity Scan Status badge from Nightly builds section. Coverity apparently has ceased to be.
2026-05-04 23:26:22 +01:00
Edward Thomson
eb0f7a734e docs: proceed when version folder doesn't exist
A version folder may not exists (for example, when adding a new
version). Proceed!
2026-05-04 23:25:08 +01:00
Edward Thomson
cf028e7e9a Merge pull request #7246 from libgit2/ethomson/redirect
Handle redirects with `Content-Length: 0` correctly
2026-05-04 21:39:51 +01:00
Edward Thomson
07c737f235 Merge pull request #7249 from kcsaul/fix/missing-library-error
cmake: fix linker error when using ninja build generator
2026-05-04 21:29:15 +01:00
Kevin Saul
50fa757381 cmake: fix linker error when using ninja build generator 2026-05-05 07:40:20 +12:00
Edward Thomson
242d66e931 httpclient: stop if there's no content length
When we were done reading headers, we checked if we needed to read a
body, or if we were done. The body check was done by looking at the
transfer encoding type and the content type. If we were chunked, then we
know we have a body (it may be a zero byte body, but we would need to
read the chunk length to know this). But looking at the content _type_
was erroneous; we should have been looking at the content _length_.

The effect of this is that when a server sends a zero byte response
with a content _type_, we try to go read the body, which does not exist.
We will hang waiting for the body that the server will never send.

Correct this typo. Now we will try to read the body if there was a
content _length_ specified, or if the transfer encoding is chunked.
2026-05-04 19:52:45 +01:00
Edward Thomson
293aa39785 httpclient: update complete_response_body explanation 2026-05-04 19:52:45 +01:00
Edward Thomson
c6de625624 ci: use the new initial-redirect:none repo
poxygit now supports a "specification" within the URI that can provide
additional details about the mock/debugging connection. The `:none`
suffix on the redirect request indicates that the proxy should send a 0
byte response body.
2026-05-04 19:52:45 +01:00
Edward Thomson
4dc25c267b Merge pull request #7248 from libgit2/ethomson/poxygit
ci: use poxygit v0.8.1 in the tests
2026-05-04 19:48:40 +01:00
Edward Thomson
c9dd053d71 ci: use poxygit v0.8.1 in the tests
Update our CI to use poxygit v0.8.1, which has additional mocking and
debugging capabilities.

As part of this, the paths to the `speed` test routes changed - now they
are `speed:<n>` where `<n>` is the speed to emulate in bps.
2026-05-04 17:47:50 +01:00
Edward Thomson
4cc873458e Merge pull request #7003 from mathworks/lrm29/issue6963
submodule: git_index_add_bypath does not move conflict entries to REU…
2026-05-03 12:48:11 +01:00
Edward Thomson
5332759cff Merge pull request #7243 from libgit2/ethomson/index-stats 2026-05-02 19:05:04 +01:00
Edward Thomson
509ac11975 Zero indexer stats in pack objects 2026-05-02 18:08:42 +01:00
Edward Thomson
38a5767ec5 Merge pull request #7001 from libgit2/ethomson/object_id
Introduce `git_object_id_from...` APIs
2026-05-02 17:36:17 +01:00
Edward Thomson
af304578e1 Merge pull request #7049 from mathworks/git_indexer_stats_init
indexer: Initialise all members of git_indexer_progress
2026-05-02 17:34:44 +01:00
Edward Thomson
63c0757b4f odb: deprecate git_odb_hash
Hash generation is not a concern of the object database; deprecate
`git_odb_hash`.
2026-05-02 14:17:21 +01:00
Edward Thomson
8bb32e5780 object: move internal use to git_object_id_from...
Using the `git_object_id_from` is an overall code simplification; switch
to it.
2026-05-02 14:17:21 +01:00
Edward Thomson
2dd70bc196 object: introduce git_object_id_from... APIs
Introduce APIs within the `git_object` namespace to calculate the IDs
of objects based on their raw content.
2026-05-02 14:17:21 +01:00
Edward Thomson
200aace53d Merge pull request #7165 from ambv/tcp-keepalive
fix: prevent SSH timeout infinite loop and enable TCP keepalive
2026-05-02 14:12:25 +01:00
Edward Thomson
16cb9c5ed8 Merge pull request #7239 from libgit2/ethomson/mergefix
merge_files: avoid UB in xdiff
2026-05-02 08:44:05 +01:00
Edward Thomson
a7b267c7a6 Merge pull request #7238 from kanru-contrib/null-terminate-pack-buffer
fix(pack): ensure pack_backend__read returns null terminated buffer
2026-05-02 08:33:47 +01:00
Edward Thomson
43b5707765 Merge pull request #7241 from kcsaul/fix/cmake-temp-header
cmake: write git.h.tmp to current binary directory
2026-05-02 08:27:13 +01:00
Edward Thomson
a25d9a18fa xdiff: don't try to malloc 0 bytes
For zero byte files, avoid allocation - this avoids undefined behavior
around malloc(0) and potentially memcpy(..., NULL, 0).
2026-05-02 08:24:18 +01:00
Edward Thomson
643b7e1038 merge_files: some simplification 2026-05-02 08:24:18 +01:00
Edward Thomson
8d4d980b10 merge_files: test with zero-byte file
Test handing a zero byte but extant file to merge_files.
2026-05-02 08:24:18 +01:00
Kevin Saul
5b59e4a180 cmake: write git.h.tmp to current binary directory 2026-05-02 13:56:47 +12:00
Kan-Ru Chen
22e80c6065 fix(pack): ensure pack_backend__read returns null terminated buffer
Depending on the zlib library used, the inflate() function may write
beyond the object size into the additional trailing buffer for aligned
memory copies. This may cause out-of-bounds memory read if the object
buffer is later used without checking the object size, as in
git_commit__extract_signature.

Link: https://github.com/zlib-ng/zlib-ng/issues/1767
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
2026-05-01 07:47:54 +09:00
Edward Thomson
cefc409a97 Merge pull request #7092 from eantoranz/git_merge_file_from_index-null_child
git_merge_file_from_index: handle cases when a child (ours or theirs) is null
2026-04-30 23:39:06 +01:00
Edward Thomson
70ff46d7fe Merge pull request #7236 from libgit2/ethomson/lengths
Check object lengths against headers in `read_loose`
2026-04-30 23:19:07 +01:00
Edward Thomson
a1c807c79e object: test looking up truncated objects
Add a test that looks up an invalid, truncated object, that is shorter
than the advertised length.
2026-04-30 22:59:20 +01:00
Edward Thomson
249b9d6aad Merge pull request #7234 from libgit2/ethomson/cmake
cmake: don't recreate git2.h unnecessarily
2026-04-29 21:33:08 +01:00
Edward Thomson
d5241a2c04 cmake: don't recreate git2.h unnecessarily
Instead of regenerating `git2.h` on every cmake invocation, use
`configure_file` to avoid rewriting it. This keeps timestamps inline and
avoids unnecessarily rebuilding the library.
2026-04-29 20:56:29 +01:00
Edward Thomson
56883f9e9d Merge pull request #7232 from kcsaul/fix/config-memory-backend
Config Memory Backend Corruption Fix
2026-04-29 20:34:40 +01:00
Edward Thomson
445193c4f8 Merge pull request #7118 from oliverchang/fix
Fixed a heap-buffer-overflow in the smart_pkt.c:set_data function.
2026-04-29 20:15:04 +01:00
Edward Thomson
81706d1b35 Merge pull request #7231 from libgit2/ethomson/worktree_fi
repository: fix operators in `foreach_worktree`
2026-04-29 15:25:34 +01:00
Kevin Saul
d30a69c63d config: fix crash after memory backend entry freed 2026-04-29 22:24:33 +12:00
Kevin Saul
3b5ecb0d42 config: update memory backend test to reproduce crash 2026-04-29 22:11:28 +12:00
Edward Thomson
c0a4ef05f4 repository: fix operators in foreach_worktree
Fix a simple operator precedence bug in
`git_repository_foreach_worktree`.
2026-04-29 09:44:05 +01:00
Edward Thomson
c16683f5fb Merge pull request #7230 from libgit2/ethomson/clar-2
clar: update with const correct iterator
2026-04-28 21:14:38 +01:00
Edward Thomson
124a1a801b clar: update with const correct iterator 2026-04-28 15:25:58 +01:00
Edward Thomson
1e7d7c07d0 Merge pull request #7195 from weihanglo/insteadof
fix: apply insteadOf from global config for detached remotes
2026-04-24 11:19:47 +01:00
Edward Thomson
8a1f012861 Merge pull request #7229 from weihanglo/fix
fix(transport): get oid_type on local transport
2026-04-24 11:14:02 +01:00
Weihang Lo
e047e80074 fix(transport): get oid_type on local transport
Cache `oid_type` in `transport_local` struct during `connect()`
so `git_remote_oid_type()` keeps working after disconnect.

This matches the smart transport behavior.
2026-04-23 23:17:57 -04:00
Weihang Lo
6753d535c8 test(transport): get oid_type on local transport
Exercise git_remote_oid_type on a SHA256 local transport.

The after-disconnect assertion is commented out because
local_oid_type dereferences `t->repo`, which local_close
has already freed (SIGSEGV).

I ran these commands to test btw:

```
cmake .. -DGIT_EXPERIMENTAL_SHA256=ON -DBUILD_TESTS=ON
cmake --build .
./libgit2_tests -snetwork::remote::local::sha256_oid_type
```
2026-04-23 23:14:01 -04:00
Weihang Lo
d375ab70c1 fix(remote): apply insteadOf from global config for detached remotes
Detached remotes already read global/system config for http proxy
settings, but did not apply url.*.insteadOf or url.*.pushInsteadOf
rules. This inconsistency meant that `git_remote_create_detached`
behaved differently from git's `ls-remote`, which was the primary
use case for detached remotes.

This fixes it by loading the default config when no repository is
provided and apply insteadOf rules consistently.

While this is a behavior change, it still respects
`GIT_REMOTE_CREATE_SKIP_INSTEADOF`, meaning that user can restore
the previous behavior with minimal effort

Fixes https://github.com/libgit2/libgit2/issues/5469
2026-04-23 18:32:11 -04:00