aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: fix sideband demux on flushAyman Bagabas2024-04-262-3/+28
| | | | | | | | Canonical Git implementation terminates the sideband stream with a flush. If the demux scanner is not terminated, it can hang the connection. Returns io.EOF when encountering a flush pkt. https://github.com/git/git/blob/master/upload-pack.c#L460
* plumbing: protocol/packp, client-side filter capability support (#1000)Nikolay Edigaryev2024-04-115-0/+160
| | | * plumbing: protocol/packp, client-side filter capability support
* plumbing: transport: use git-proto-request and decode error-line errorsAyman Bagabas2023-11-232-2/+106
|
* plumbing: add git-proto-request typeAyman Bagabas2023-11-232-0/+120
| | | | | | This the request used for the git transport protocol feat: nil writer
* plumbing: protocol/packp, Add validation for decodeLinePaulo Gomes2023-10-072-5/+34
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* fuzzing : fuzz testing support for oss-fuzz integrationArjun Singh2023-10-021-0/+12
| | | | Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
* *: fix some typosZhizhen He2023-09-082-2/+2
| | | | Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
* plumbing: packp, A request is not empty if it contains shallows. Fixes #328Arieh Schneier2023-07-022-3/+10
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: http, Fix empty repos on Git v2.41+Paulo Gomes2023-07-012-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>
* *: Add missing error checksPaulo Gomes2023-05-111-7/+7
| | | | | | | | Some areas of the code base were missing error checks, without them it may be harder to troubleshoot unexpected behaviours. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-115-25/+21
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: Support variable length plumbing.HashPaulo Gomes2023-03-081-2/+3
| | | | | | | | | | | | The variable length for plumbing.Hash is defined at build time, blocked by tag sha256. This approach was a trade-off between keeping backwards compatibility while making progress towards supporting SHA256 with a small amount of changes. Relates to the SHA256 implementation, defined in #706. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* Allow unsupported multi_ack capabilityPaulo Gomes2022-11-164-12/+41
| | | | | | | | | | | | | | | | | | | | Azure DevOps requires capabilities multi_ack / multi_ack_detailed, which are not fully implemented and by default are included in transport.UnsupportedCapabilities. The initial clone operations require a full download of the repository, and therefore those unsupported capabilities are not as crucial, so by removing them from that list allows for the first clone to work successfully. Additional fetches will yield issues, therefore to support that repository users have to work from a clean clone until those capabilities are fully supported. Commits and pushes back into the repository have also been tested and work fine. This change adds an example for cloning Azure DevOps repositories. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: packp and server, Include the contents of ↵🚀 Steven Ewing 🌌2022-09-224-3/+38
| | | | `GO_GIT_USER_AGENT_EXTRA` as the git user agent. Fixes #529
* plumbing: packp, Avoid duplicate encoding when overriding a Capability ↵Tyler Christensen2022-05-012-1/+14
| | | | | | | | | value. (#521) Previously, calling `Set($CAPABILITY, ...)` on a `capability.List` where `$CAPABILITY` was already present would correctly replace the existing value of that capability, but would also result in that capability being listed twice in the internal `l.sort` slice. This manifested publicly when the `List` was encoded as the same capability appearing twice with the same value in the encoded output.
* plumbing: protocol/pakp, update agent Carlos Alexandro Becker2022-01-194-5/+5
| | | Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* Merge pull request #418 from abhinav/unusedMáximo Cuadros2021-12-103-6/+0
|\ | | | | Remove unused vars/types/funcs/fields
| * Remove unused variables/types/functionsAbhinav Gupta2021-11-273-6/+0
| | | | | | | | | | | | | | | | [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.
* | Merge branch 'master' into jc-push-atomicMáximo Cuadros2021-12-101-3/+3
|\ \
| * | packp: Actions should have type ActionAbhinav Gupta2021-11-271-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per the [Go Spec](https://go.dev/ref/spec#Constant_declarations), the following yields the type `Action` for `Bar` and `Baz` only if there is no `=`. const ( Foo Action = ... Bar Baz ) The following has the type `Action` for the first item, but not the rest. Those are untyped constants of the corresponding type. const ( Foo Action = ... Bar = ... Baz = ... ) This means that `packp.{Update, Delete, Invalid}` are currently untyped string constants, and not `Action` constants as was intended here. This change fixes these.
* / Add Atomic to push optionsJohn Cai2021-11-031-0/+19
|/ | | | | | push --atomic allows a push to succeed or fail atomically. If one ref fails, the whole push fails. This commit allows the user to set Atomic as an option for a push.
* plumbing: packp, Add encoding for push-options. Fixes #268.Sören Bohn2021-10-263-1/+53
| | | | go-git: Add field `Options` to `PushOptions`, wire functionality.
* *: use go-billy instead of os callsMáximo Cuadros2021-05-023-146/+5
|
* Adding "object-format" and "filter" capabilities (#222)Roberto O. Fernández Crisial2021-01-271-1/+8
| | | | * plumbing: protocol/packp, Adding object-format and filter capabilities. Fixes #220
* Merge pull request #125 from cristaloleg/minor-linter-fixesMáximo Cuadros2020-07-161-4/+1
|\ | | | | *: minor linter fixes
| * Minor linter fixesOleg Kovalov2020-07-061-4/+1
| |
* | Use only one name for receiverOleg Kovalov2020-07-065-32/+32
|/
* fix goreportcard warningsOleg Kovalov2020-07-011-1/+1
|
* plumbing: transport, fix handling of empty adv-refs on upload-packMáximo Cuadros2020-04-072-9/+23
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-1032-69/+69
|
* Fix typos in comments, variables and function namesOleksandr Redko2019-10-247-17/+17
| | | | Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
* *: avoid unnecessary conversionsChristian Muehlhaeuser2019-07-292-2/+2
| | | | | | | No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
* Resolve HEAD if symRefs capability is not supportedAntonio Jesus Navarro Perez2018-03-262-9/+172
| | | | Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* all: simplificationferhat elmas2017-11-296-10/+10
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* examples,plumbing,utils: typo fixesferhat elmas2017-11-203-4/+4
|
* packp/capability: Skip argument validations for unknown capabilitiesOri Rawlings2017-10-233-11/+36
| | | | Fixes #623
* Add sideband support for pushOri Rawlings2017-09-011-0/+4
|
* packp: fixed encoding when HEAD is not a valid refManuel Carmona2017-08-182-38/+56
|
* Merge pull request #475 from mcuadros/fix-ackMáximo Cuadros2017-07-122-23/+42
|\ | | | | plumbing: protocol, fix handling multiple ACK on upload-pack and test…
| * plumbing: protocol, fix handling multiple ACK on upload-packMáximo Cuadros2017-07-122-23/+42
| |
* | Merge pull request #472 from smola/fix-caps-delete-refsMáximo Cuadros2017-07-111-0/+1
|\ \ | |/ |/| improve delete support on push
| * improve delete support on pushSantiago M. Mola2017-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * server: implement delete-refs and announce it. * remote: check if server announced delete-refs before trying to delete and fail fast if it does not. Note that the client does not need no send 'delete-refs' back to the server to be able to delete references: ``` delete-refs ----------- If the server sends back the 'delete-refs' capability, it means that it is capable of accepting a zero-id value as the target value of a reference update. It is not sent back by the client, it simply informs the client that it can be sent zero-id values to delete references. ``` So our server implementation does not check if the client sent delete-refs back, it just accepts deletes if it receives them.
* | plumbing: protocol, fix handling multiple ACK on upload-packMáximo Cuadros2017-07-084-17/+76
|/
* capability: accept unknown capabilities, fixes #450Santiago M. Mola2017-06-232-10/+6
| | | | | | | | | GitHub has started using a non-standard capability "early-capabilities" with agent=git/github-g3daa19f21. This is breaking all go-git operations on GitHub. This commit removes validation for known capabilities, so that we can use non-standard capabilities safely.
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-0732-68/+68
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* Remove TODOs from documentationAntonio Jesus Navarro Perez2017-02-282-2/+2
|
* package plumbing documentation improvements (#248)Máximo Cuadros2017-02-071-1/+2
|
* documentation changesMáximo Cuadros2017-01-312-3/+2
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-3032-68/+68
|
* Fix some typos in plumbing docs (#244)Sergio Arbeo2017-01-301-4/+4
|