aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: allow discovery of non bare repos in fsLoaderJakob Möller2024-08-212-9/+37
|
* adjust path extracted from file: url on Windows (#416)tomqwpl2024-08-091-1/+18
| | | | | * adjust path extracted from file: url on Windows Fixes #415
* plumbing: transport/ssh, Add support for SSH @cert-authority.Javier Alvarez Garcia2024-07-243-12/+124
| | | | | | | | | | | | skeema/knownhosts v1.3.0 introduced a HostKeyDB type that extends the HostKeyCallback functionality to support @cert-authority algorithms. `known_hosts` files may contain lines with @cert-authority markers to indicate that a line corresponds to a certificate instead of a key. If a git remote uses cert authorities as the preferred host identification mechanism, the functionality added in skeema/knownhosts v1.3.0 is needed so that go-git can interact with this remote. See https://github.com/skeema/knownhosts/pull/9 for details.
* plumbing: transport/file, Change paths to absolutePaulo Gomes2024-07-132-7/+35
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: transport/http, Wrap http errors to return reason. Fixes #1097Gianni Gambetti2024-05-274-9/+11
|
* Merge pull request #937 from matejrisek/feature/rename-short-fieldsPaulo Gomes2024-03-163-17/+17
|\ | | | | Replace short field names with more descriptive ones.
| * plumbing: Replace short field names with more descriptive ones.Matej Risek2023-11-193-17/+17
| | | | | | | | | | The decision to change the name of these fields came from reading the code further down in the scope and not being clear what `c.c` means.
* | plumbing: check setAuth error. Fixes #185nodivbyzero2023-12-132-1/+26
| |
* | plumbing: transport: use git-proto-request and decode error-line errorsAyman Bagabas2023-11-233-112/+51
|/
* plumbing: transport/git, Improve tests error messagePaulo Gomes2023-11-171-5/+15
| | | | | | | | | When running the tests in an install in which git daemon is not installed (e.g. openSUSE), all the git transport tests will fail with a connection refused error. This was due the git server not being running in the first place. The tests will now fail with 'git daemon cannot be found'. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: fix empty uploadpack request errorAyman Bagabas2023-11-161-0/+6
| | | | | | | | | | If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.com/go-git/go-git/issues/328 Fixes: https://github.com/go-git/go-git/issues/638 Fixes: https://github.com/go-git/go-git/issues/157
* utils: remove ioutil.Pipe and use std library io.PipeAyman Bagabas2023-11-132-3/+2
| | | | ioutil.Pipe literally calls io.Pipe.
* build: fix go-git binary buildAyman Bagabas2023-11-071-2/+2
|
* plumbing: transport/ssh, Fix nil pointer dereference caused when an ↵Anand Francis Joseph2023-11-022-5/+27
| | | | | | unreachable proxy server is set. Fixes #900 Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
* plumbing: transport/common, Improve handling of remote errorsMax Jonas Werner2023-10-123-4/+124
| | | | | | | | | | | Instead of simply returning the first line that the remote returned, go-git now actively searches all of stderr for lines that may contain a more actionable error message and returns that. In addition, this change adds a case to map the GitLab-specific error message to an ErrRepositoryNotFound error. Signed-off-by: Max Jonas Werner <mail@makk.es>
* fuzzing : fuzz testing support for oss-fuzz integrationArjun Singh2023-10-021-0/+7
| | | | Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
* *: fix some typosZhizhen He2023-09-081-1/+1
| | | | Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
* plumbing: Do not swallow http message coming from VCS providers.matej.risek2023-09-054-4/+35
| | | | | | For diagnostics reasons we want to surface error messages coming from VCS providers. That's why we introduce the reason field to Err struct in http package. This field can be used by an end user of the library in order to better understand failures.
* plumbing: transport, handle IPv6 while parsing endpoint. Fixes #740merlin2023-07-262-1/+19
|
* plumbing: packp, A request is not empty if it contains shallows. Fixes #328Arieh Schneier2023-07-021-1/+1
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: http, Fix empty repos on Git v2.41+Paulo Gomes2023-07-011-0/+11
| | | | | | | | | | | | Git v2.41.0 comes with [changes](https://github.com/git/git/commit/933e3a4ee205353d8f093d5dfcd226fa432c4e58) that breaks go-git's assumptions for when detecting empty repositories. Go-git expects a flush instead of the first hash line. Instead, a dummy capabilities^{} with zero-id is returned. The change aims to allow for identifying the object format even when cloning empty repositories. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: Replace fmt.Sprintf with net.JoinHostPortPaulo Gomes2023-05-112-4/+5
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-1111-26/+14
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: transport/http, add support for custom proxy URLsSanskar Jaiswal2023-05-047-1/+307
| | | | | | | | | | | | | | Add support for custom HTTP and HTTPS proxies for each session. The tests require server certificate and a matching private key to be able to run a TLS server and test HTTPS proxy functionality. The cert and the key are stored in `plumbing/transport/http/testdata/certs` and were generated using the following command: `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt` Note: All details were left empty, except for the FQDN for which example.com was used. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
* plumbing: transport/http, refactor transport to cache underlying transport ↵Sanskar Jaiswal2023-05-046-45/+230
| | | | | | | | | | | | | objects Refactor the in-built http transport to cache the underlying http transport objects mapped to its specific options for each Git transport object. This lets us reuse the transport for a specific set of configurations as recommended. (ref: https://pkg.go.dev/net/http#Transport) If there are no transport specific options provided, the default transport is used. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
* plumbing: transport/ssh, add support for custom proxy URLsSanskar Jaiswal2023-05-045-14/+287
| | | | Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
* plumbing/transport: add ProxyOptions to specify proxy detailsSanskar Jaiswal2023-05-041-0/+31
| | | | Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
* internal: Fix regression in csp-like matchJoseda Rios2023-04-151-4/+16
| | | | Signed-off-by: Joseda Rios <josriolop@gmail.com>
* Merge pull request #655 from aymanbagabas/hostkeycallbackPaulo Gomes2023-03-064-43/+101
|\ | | | | fix(ssh): unable to pass a custom HostKeyCallback func
| * fix(ssh): unable to pass a custom HostKeyCallback funcAyman Bagabas2023-03-054-43/+101
| | | | | | | | | | | | | | | | Don't overwrite HostKeyCallback if one is provided. Fixes: c35b8082c863 ("plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes #411") Fixes: https://github.com/go-git/go-git/issues/654 Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
* | fix: don't use the `firstErrLine` when it is emptyThinkChaos2023-02-212-1/+15
|/ | | | | Returning `nil` causes `handleAdvRefDecodeError` to fall back to `io.ErrUnexpectedEOF`.
* *: fix some typos (#567)cui fliter2022-09-221-1/+1
| | | | | Signed-off-by: cui fliter <imcusg@gmail.com> Signed-off-by: cui fliter <imcusg@gmail.com>
* plumbing: packp and server, Include the contents of ↵🚀 Steven Ewing 🌌2022-09-221-2/+2
| | | | `GO_GIT_USER_AGENT_EXTRA` as the git user agent. Fixes #529
* plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes ↵Evan Elias2022-09-222-17/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | #411 This commit adjusts the transport/ssh logic in command.connect(), so that it now auto-populates ssh.ClientConfig.HostKeyAlgorithms. The algorithms are chosen based on the known host keys for the target host, as obtained from the known_hosts file. In order to look-up the algorithms from the known_hosts file, external module github.com/skeema/knownhosts is used. This package is just a thin wrapper around golang.org/x/crypto/ssh/knownhosts, adding an extra mechanism to query the known_hosts keys, implemented in a way which avoids duplication of any golang.org/x/crypto/ssh/knownhosts logic. Because HostKeyAlgorithms vary by target host, some related logic for setting HostKeyCallback has been moved out of the various AuthMethod implementations. This was necessary because the old HostKeyCallbackHelper is not host-specific. Since known_hosts handling isn't really tied to AuthMethod anyway, it seems reasonable to separate these. Previously-exported types/methods remain in place for backwards compat, but some of them are now unused. For testing approach, see pull request. Issue #411 can only be reproduced via end-to-end / integration testing, since it requires actually launching an SSH connection, in order to see the key mismatch error triggered from https://github.com/golang/go/issues/29286 as the root cause.
* minor grammatical fixesJon Eskin2022-09-221-2/+2
|
* all: replace go-homedir with os.UserHomeDirDaniel Martí2022-05-291-5/+6
| | | | Added in Go 1.12, this means we need one less dependency.
* Remove unused variables/types/functionsAbhinav Gupta2021-11-273-12/+1
| | | | | | | | [staticcheck](https://staticcheck.io/) reported a number of unused fields, functions, types, and variables across the code. Where possible, use them (assert unchecked errors in tests, for example) and otherwise remove them.
* git: Add support for deepening shallow clones (#311)Marcus Watkins2021-05-121-1/+1
|
* plumbing: transport/http, skip flaky testMáximo Cuadros2021-05-031-0/+4
|
* *: use go-billy instead of os callsMáximo Cuadros2021-05-023-7/+26
|
* utils: ioutil, Pipe implementatioMáximo Cuadros2021-05-022-2/+3
|
* plumbing: transport/file, replace os/exec with golang.org/x/sys/execabs to ↵Máximo Cuadros2021-04-171-9/+9
| | | | improve path security
* plumbing: transport/ssh, support more formats in `NewPublicKeys` SSH helper ↵Hidde Beydals2021-04-172-18/+11
| | | | | | | | | | | | | | | (#298) * Add failing ED25519 encrypted PEM test Signed-off-by: Hidde Beydals <hello@hidde.co> * Support more formats in `NewPublicKeys` SSH helper By switching to `ParsePrivateKey` and `ParsePrivateKeyWithPassphrase` from `crypto/ssh`, which has support for RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. Signed-off-by: Hidde Beydals <hello@hidde.co>
* plumbing: transport/ssh, fix no agent test on windowsv5.3.0Máximo Cuadros2021-03-291-1/+1
|
* *: fix flaky testMáximo Cuadros2021-03-261-0/+4
|
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-267-7/+64
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* transport: ssh, fix cloning large repositories (#272)David Cuadrado2021-03-262-1/+29
| | | | | | | | | | | | | | | | | * Fix cloning large repositories Ignore the error on close when the connection is already closed Fixes #70 * Compatibility for go 1.13 Because it's required by the pipeline * Add test for allowing to close a command when the client is already closed This test is for issue #70 * Add debug information for broken test
* Add insecureSkipTLS and cabundle (#228)Daishan Peng2021-01-272-1/+40
| | | | | This PR add insecureSkipTLSVerify and cabundle to any remote http calls so that https repo with private CA signed can be used. This is the equivalent of https.sslVerify and GIT_SSL_CAINFO
* fix nilOleg Kovalov2020-07-013-3/+3
|
* fix goreportcard warningsOleg Kovalov2020-07-018-9/+9
|