Commit Graph

16094 Commits

Author SHA1 Message Date
Edward Thomson
77c217f173 Merge pull request #7183 from weihanglo/smart
fix(smart): keep caps across RPC stream resets
2026-01-11 00:55:29 +00:00
Edward Thomson
0f07d810fe Merge pull request #7189 from libgit2/ethomson/clar-update
clar: update to latest
2026-01-10 20:42:52 +00:00
Edward Thomson
219730325e clar: update to latest 2026-01-10 20:17:08 +00:00
Edward Thomson
b154967667 Merge pull request #7186 from AHSauge/fix/optimise-git-oid-is-zero
Use git_oid_raw_cmp instead of custom loop in git_oid_is_zero
2026-01-10 13:33:58 +00:00
Edward Thomson
e2105f3a8b Merge pull request #7181 from Murmele/wrong_comment
fix wrong comment
2026-01-10 13:32:58 +00:00
Edward Thomson
dff04d9dcc Merge pull request #7187 from libgit2/ethomson/nsec
index: support USE_NSEC=OFF
2026-01-08 23:04:55 +00:00
Edward Thomson
a09440a4f5 index: support USE_NSEC=OFF
Ideally, nobody should be building without nanosecond precision. But
support them if they do.
2026-01-08 22:39:56 +00:00
Edward Thomson
c5105a07dd Merge pull request #7172 from Oblivionsage/main
delta: fix undefined behavior in hdr_sz varint parsing
2026-01-08 21:25:44 +00:00
Edward Thomson
28b244aa40 Merge pull request #7179 from weihanglo/sha256
fix(sha256): pass correct oid type
2026-01-08 14:33:25 +00:00
Edward Thomson
6460642539 Merge pull request #7173 from libgit2/ethomson/clar-update
tests: update to latest clar
2026-01-08 14:32:33 +00:00
Edward Thomson
6a41fb7870 tests: update to latest clar 2026-01-08 01:03:42 +00:00
Edward Thomson
2c3ce41c60 Merge pull request #7166 from bakersdozen123/main
Add swift-libgit2 language binding to README
2026-01-07 23:01:57 +00:00
Edward Thomson
9ced0a3731 Merge pull request #7175 from qaqland/main
examples: correct `git_commit_time` comment
2026-01-07 22:59:17 +00:00
Alf Henrik Sauge
73b8b4eb74 Use git_oid_raw_cmp instead of custom loop in git_oid_is_zero
Since git_oid_raw_cmp uses memcmp, it's far easier to optimise more aggressively.
Given that it's static const and used inlined, it seems reasonable to assume that git_oid_zero will be optimised away in release. 
This is at least the case with x86-64 and GCC 15.2.1.
2026-01-06 20:20:46 +01:00
Weihang Lo
e15479a7dc fix(smart): keep caps across RPC stream resets
Preserve ref-advertised capabilities when only the stream is reset.

This prevents losing `object-format` before `git_remote_oid_type()`
and fixes SHA256 clone pack trailer mismatch.

Fixes libgit2/libgit2#7182
2026-01-03 22:02:42 -05:00
Martin Marmsoler
0e3200a8fc fix wrong comment 2026-01-03 17:02:51 +01:00
Weihang Lo
e1cd4f6595 fix(sha256): pass correct oid type
These are SHA256 TODO leftover.
In the surrounding context they all have the required oid type around,
so I just picked up them and pass in.

Found during SHA256 support integration with Rust git-rs binding
2026-01-03 10:12:12 -05:00
qaqland
196c465995 examples: correct git_commit_time comment 2025-12-31 16:36:04 +08:00
Oblivionsage
4e6b493787 delta: fix undefined behavior in hdr_sz varint parsing
The expression (c & 0x7f) << shift in hdr_sz() causes undefined
behavior when shift >= 32, because (c & 0x7f) is an unsigned int
(32-bit type). A malicious delta with a long varint can trigger this.

Fix by:
1. Casting to size_t before shifting to support 64-bit shifts
2. Adding a shift limit check to reject overlong varints
2025-12-24 16:46:30 +01:00
Edward Thomson
3ac4c0adb1 Merge pull request #7148 from roberth/refs-shorthand-multi-segment
refs: honor REFSPEC_SHORTHAND for multi-segment refs
2025-12-20 13:08:02 +00:00
Edward Thomson
cd3ebc944e Merge pull request #7164 from ambv/fix-discarded-qualifiers
ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2
2025-12-20 13:05:42 +00:00
Edward Thomson
1fed8b2e95 Merge pull request #7167 from ambv/macos-14 2025-12-19 21:05:34 +00:00
Łukasz Langa
0bf4714508 (Another bump, this time github.com was not accessible from GitHub Actions) 2025-12-12 00:42:53 +01:00
Łukasz Langa
2b7114047e (bump CI as curl failed) 2025-12-11 19:01:19 +01:00
Łukasz Langa
81ba023838 Some versions of leaks want -exclude to not have a space 2025-12-11 18:11:50 +01:00
Łukasz Langa
ed1f2f7eb1 Exclude leaks in SSLHandshake 2025-12-11 17:05:48 +01:00
Łukasz Langa
a44b3257ba Also update nightlies 2025-12-11 12:29:56 +01:00
Łukasz Langa
c81b74fe76 Use macos-14 for experimental features, too 2025-12-11 12:28:44 +01:00
Łukasz Langa
97d17cced3 Switch to macos-14 as macos-13 runners are now retired 2025-12-11 12:28:30 +01:00
bakersdozen123
098a1a58bf Add swift-libgit2 language binding to README 2025-12-10 18:35:22 -08:00
Łukasz Langa
fadbef196e ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2 2025-12-06 23:02:39 +01:00
Edward Thomson
610dcaac06 Merge pull request #7153 from ambv/fix-iterator-index-case-folding-test-docker 2025-12-06 21:54:41 +00:00
Edward Thomson
ce0524670c Merge pull request #7120 from xokdvium/refspec-del
refspec: Detect DEL character in is_valid_name
2025-12-06 17:54:52 +00:00
Edward Thomson
a136eb0c8d Merge pull request #7130 from orgads/init-locals
Fix potential access to uninitialized variables
2025-12-06 17:48:28 +00:00
Edward Thomson
3c30b6fab3 Merge pull request #7138 from jar-of-salt/git-authors-docs-update
Fix Contributing Docs: Incorrect Git Authors Link
2025-12-06 17:46:10 +00:00
Edward Thomson
96eddf51f9 Merge pull request #7161 from ibrahimcetin/add-swiftgitx
Add SwiftGitX to README bindings list
2025-12-06 17:44:42 +00:00
Edward Thomson
31ab9b66c7 Merge pull request #7152 from ambv/update-fedora-docker
ci: update ci/docker/fedora to work with Rawhide 44
2025-12-06 17:38:41 +00:00
Edward Thomson
9fd0741910 Merge pull request #7154 from ShiningMassXAcc/fix-C4703
Fix C4703 uninitialized pointer variable warnings
2025-12-06 17:36:57 +00:00
Edward Thomson
6af47d3989 Merge pull request #7155 from aware70/use-cmake-install-includedir-for-install-interface
Use CMAKE_INSTALL_INCLUDEDIR for libgit2package INSTALL_INTERFACE
2025-12-06 17:28:55 +00:00
Edward Thomson
80cc5c6bd6 Merge pull request #7119 from ehuss/cert_cb-always-called
Update documentation to clarify that cert cb is always called
2025-12-06 17:25:38 +00:00
Edward Thomson
cfed471032 Merge pull request #7102 from pks-gitlab/pks-refformat-extension
Introduction of the "refFormat" extension
2025-12-06 16:58:16 +00:00
Edward Thomson
092bf79393 Merge pull request #7163 from libgit2/ethomson/ssh_exec_updates
SSH exec updates
2025-12-06 16:41:10 +00:00
Edward Thomson
7af54d0866 Merge pull request #7146 from bakersdozen123/fix/custom-ssh-heap-overflow
ssh: fix custom ssh heap buffer overflow
2025-12-06 13:24:59 +00:00
Edward Thomson
7ed8f12087 ssh_exec: use GIT_SSH_COMMAND in tests
We specify additional arguments to the ssh executable; as a result, we
specify arguments with `GIT_SSH_COMMAND`.
2025-12-01 21:44:36 +00:00
Edward Thomson
dfadbd0c8f ssh_exec: support GIT_SSH_COMMAND
Look for the `GIT_SSH_COMMAND` environment variable and prefer it to
`GIT_SSH`. The `GIT_SSH_COMMAND` will execute via the shell, which is
useful to provide additional arguments.
2025-12-01 21:44:36 +00:00
Edward Thomson
f05143b946 ssh_exec: escape remote paths properly
When sending paths to the remote server, escape them properly.
Escape them with a single quote, followed by the escaped character,
followed by another single quote. This prevents misparsing on the
remote side and potential command injection.
2025-12-01 21:44:36 +00:00
Edward Thomson
4c9134e501 str: allow escaping with prefix and suffix
Allow `git_str_puts_escaped` to take an escaping prefix and an escaping
suffix; this allows for more options, including the ability to better
support escaping executed paths.
2025-12-01 21:44:36 +00:00
Edward Thomson
adac288376 str: add case insensitive suffixcmp 2025-12-01 21:44:36 +00:00
Edward Thomson
479a1b5a92 ssh_exec: don't use sh for ssh execution
Construct the arguments for the ssh exec as an explicit array, instead
of trying to create a command-line for sh. The latter may use user input
(the remote path) so this may be vulnerable to command injection.
2025-12-01 21:44:36 +00:00
Edward Thomson
2ad709e77c process: resolve paths for win32
When using `git_process_new` on win32, resolve the path to the
application in the same way that we do on POSIX.

Search `PATH` for command to execute (unless the given executable is
fully qualified). In addition, better match Windows executable lookup
behavior itself (allowing the command to be `foo`, and looking for a
matching `foo.exe` or `foo.cmd`.)
2025-12-01 21:44:36 +00:00