Commit Graph

15144 Commits

Author SHA1 Message Date
Edward Thomson
7b6de860a3 http: don't enforce content-type
Proper git servers generally respond with a predictable content-type
(like `x-git-upload-pack-response`). But apparently not all do, and
we should not enforce that.
2023-08-10 11:29:16 +01:00
Edward Thomson
95f3d41364 Merge pull request #6619 from libgit2/revert-6586-fix/cmake_msvc
Revert "CMake: Search for ssh2 instead of libssh2."
2023-08-10 10:39:04 +01:00
Edward Thomson
52db5d11c5 Revert "CMake: Search for ssh2 instead of libssh2." 2023-08-10 09:52:04 +01:00
Edward Thomson
804506ba57 Merge pull request #6597 from mathworks/proxy_invalid_url_crash
proxy: Return an error for invalid proxy URLs instead of crashing.
2023-08-02 20:46:05 +01:00
Edward Thomson
38b60fd062 winhttp: use new http-style url parser for proxies 2023-08-02 11:02:44 +01:00
Edward Thomson
5a64922408 http: test proxies in url and host:port format
Test proxies specified by both host:port format in configuration
options, environment variables, and `http.proxy` configuration.
2023-08-02 09:46:12 +01:00
Edward Thomson
b6fdb3cbdf http: allow proxies to be specified in common format
The common format for specifying proxy URLs is just 'host:port'. Handle
the common case.
2023-08-01 14:12:01 +01:00
Edward Thomson
8749655745 net: introduce http-biased url parsing
Introduce a url parser that defaults to treating poorly specified URLs
as http URLs. For example: `localhost:8080` is treated as
`http://localhost:8080/` by the http-biased url parsing, instead of a
URL with a scheme `localhost` and a path of `8080`..
2023-08-01 14:12:01 +01:00
Edward Thomson
8c2c0fa80a net: refactor url parsing
Refactor url parsing to simplify the state-passing (introducing a
struct) and add a path parser for future reusability.
2023-08-01 14:12:01 +01:00
Edward Thomson
a79aa14206 httpclient: safety 2023-08-01 14:12:01 +01:00
Edward Thomson
782c4d4d8f Merge pull request #6599 from steven9724/fix-ssh-memleak
ssh: fix known_hosts leak in _git_ssh_setup_conn
2023-07-30 09:03:37 +01:00
Edward Thomson
593ff41b34 Merge pull request #6610 from mascguy/mascguy-errSSLNetworkTimeout
stransport: macOS: replace errSSLNetworkTimeout, with hard-coded value
2023-07-27 22:52:32 +02:00
Christopher Nielsen
3e15292d88 stransport: macos: replace errSSLNetworkTimeout, with hard-coded value
- Constant only available in 10.13+, causing build failures for older macOS releases
Fixes: https://github.com/libgit2/libgit2/issues/6606
2023-07-24 20:43:23 -04:00
Edward Thomson
42b5d85276 Merge pull request #6608 from dvzrv/dvzrv/fix_git_oidarray_import
fix: Add missing include for oidarray.
2023-07-22 14:41:04 +01:00
David Runge
f7c746a2ef fix: Add missing include for oidarray.
Add a missing include for `git2/oidarray.h` so build doesn't fail on
using `git_oidarray` when using custom transports.

Fixes #6607
2023-07-21 16:18:39 +02:00
lmcglash
d48a5d5104 Validate proxy URL on Windows. 2023-07-19 14:33:39 +01:00
steven9724
1a1464176b ssh: fix known_hosts leak in _git_ssh_setup_conn 2023-07-18 14:46:18 +01:00
Edward Thomson
9903482593 Merge pull request #6600 from libgit2/cmn/clear-graft-pointers
repository: make cleanup safe for re-use with grafts
2023-07-18 14:36:18 +01:00
Carlos Martín Nieto
9d4c550564 repository: make cleanup safe for re-use with grafts
We are allowed to call `git_repository__cleanup` multiple times, and this
happens e.g. in rugged if we want to free up resources before GC gets around to
them.

This means that we cannot leave dangling pointers in it, which we were doing
with the grafts. Fix this by setting the pointers to NULL after freeing the resources.
2023-07-18 12:31:46 +02:00
lmcglash
89bc8ff982 Return an error for invalid proxy URLs instead of crashing. 2023-07-17 21:43:55 +01:00
Edward Thomson
136e55f296 Merge pull request #6596 from libgit2/ethomson/update_version_numbers
meta: update version numbers to v1.8
2023-07-17 11:59:12 +01:00
Edward Thomson
62498558ff meta: update version numbers to v1.8 2023-07-17 11:07:50 +01:00
Edward Thomson
3e2baa6d0b Merge pull request #6594 from libgit2/ethomson/v1.7
v1.7: release Kleine Raupe Nimmersatt
v1.7.0
2023-07-17 11:01:05 +01:00
Edward Thomson
c375d0b7c8 v1.7: update changelog 2023-07-17 10:33:28 +01:00
Edward Thomson
bdd031576b v1.7: update version numbers 2023-07-17 10:33:15 +01:00
Edward Thomson
bf68ce217d Merge pull request #6593 from libgit2/ethomson/pcre-8.45
deps: update pcre to 8.45
2023-07-15 21:29:19 +01:00
Edward Thomson
c02fe8d279 deps: update pcre to 8.45 2023-07-15 16:16:48 +01:00
Edward Thomson
2b55e59f60 meta: update GitHub release labels 2023-07-15 15:46:06 +01:00
Edward Thomson
9b3d9c65a5 meta: update GitHub release labels 2023-07-15 15:43:51 +01:00
Edward Thomson
e3e0564a5f Merge pull request #6577 from cavaquinho/fix/workdir_to_index_untracked_reverse
#6576 git_diff_index_to_workdir reverse now loads untracked content
2023-07-15 14:57:09 +01:00
Edward Thomson
58be98b71b Merge pull request #6563 from libgit2/pks/test-allocator
tests: add allocator with limited number of bytes
2023-07-15 14:00:35 +01:00
Edward Thomson
47dcc4bc49 Merge pull request #6345 from arroz/fix/branch-move-reflog
Fixes #6344: git_branch_move now renames the reflog instead of deleting.
2023-07-15 09:55:59 +01:00
Edward Thomson
633cde015d Merge pull request #6539 from cavaquinho/fix/revwalk-insert-by-date
Partial fix for #6532: insert-by-date order.
2023-07-15 09:53:03 +01:00
Edward Thomson
15e42fb55b Merge pull request #6585 from libgit2/cmn/midx-no-oid-verify
midx: do not try to look at every object in the index
2023-07-15 09:49:10 +01:00
Edward Thomson
40ed228bf9 Merge pull request #6584 from libgit2/cmn/pack-index-size
pack: cast the number of objects to size_t
2023-07-14 17:18:55 +01:00
Edward Thomson
72b5c53124 Merge pull request #6586 from Faless/fix/cmake_msvc
CMake: Search for ssh2 instead of libssh2.
2023-07-14 17:15:45 +01:00
Edward Thomson
59e9df3ca9 Merge pull request #6583 from libgit2/cmn/midx-unknown-chunk
midx: allow unknown chunk ids in multi-pack index files
2023-07-14 15:02:23 +01:00
Edward Thomson
a237aba6de Merge pull request #6590 from vincenzopalazzo/macros/fix-docs
docs: fix IRC server from freenode to libera
2023-07-14 13:14:13 +01:00
Vincenzo Palazzo
27b40287a0 docs: fix IRC server from freenode to libera
This commit update the contributing documents with the
new IRC server and remove the old freenode.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-07-09 16:49:46 +02:00
Fabio Alessandrelli
933c09dbec CMake: Search for ssh2 instead of libssh2.
Fixes "CMake Error: could not resolve ssh2" on Windows-MSVC.
2023-06-25 07:15:02 +02:00
Carlos Martín Nieto
c1aa0213e1 midx: do not try to look at every object in the index
Similar to previous issues around doing way too much verification at loading
time, checking whether the object index chunk is monotonic is better left for
git-fsck instead of every single time we want to look at something in the
repository.

As midx files grow, this starts taking more and more times. As an example, I
went looking for this because it's taking about 1.5s to do a single object
lookup in a repository that's ended up with a 7G multi-pack-index file.
2023-06-22 12:08:31 +02:00
Carlos Martín Nieto
1bbe0dd89d pack: cast the number of objects to size_t
Similar to a previous change where we had to change the casting when loading the
index file, we also need to make sure we don't restrict the numbers to 32-bit
when looking up objects in packfiles.

This was done about three years ago in git itself, but we never got he update in
this library.
2023-06-22 11:03:36 +02:00
Carlos Martín Nieto
f576b7dd02 midx: allow unknown chunk ids in multi-pack index files
These chunks work like extensions where it's fine not to know what one means. We
can skip over it and keep processing the file instead of erroring out.
2023-06-22 09:54:11 +02:00
Miguel Arroz
4a2c4cc93f #6576 git_diff_index_to_workdir reverse now loads untracked content 2023-06-09 18:21:13 -07:00
Edward Thomson
f041a94e2c Merge branch 'worktree_prunable' (PR #5712) 2023-05-16 12:41:41 +01:00
Edward Thomson
12b54ae009 worktree: document that is_prunable sets error messages
When a worktree is not prunable, an error message will be set with
information about why. Document that.
2023-05-16 12:40:16 +01:00
Edward Thomson
372143244d worktree: update prunable to reflect refactorings
PR #5712 predates several refactorings to move the utility code into a
more general purpose codebase. Update to reflect the refactorings.
2023-05-16 12:38:43 +01:00
Reginald McLean
05719c55ff Refactor git_worktree_is_prunable slightly to fix memory leak 2023-05-16 12:32:35 +01:00
Reginald McLean
86db1ad5dc Added check if gitdir exists in is_prunable()
Fixes #5598
2023-05-16 12:31:46 +01:00
Reginald McLean
0fd80681f9 Added missing is_prunable test 2023-05-16 12:31:16 +01:00