aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/internal
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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>
* 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>
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-111-2/+1
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.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`.
* Remove unused variables/types/functionsAbhinav Gupta2021-11-271-5/+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.
* git: Add support for deepening shallow clones (#311)Marcus Watkins2021-05-121-1/+1
|
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-261-3/+7
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* plumbing: transport, fix handling of empty adv-refs on upload-packMáximo Cuadros2020-04-071-0/+7
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-102-9/+9
|
* Fix typos in comments, variables and function namesOleksandr Redko2019-10-242-2/+2
| | | | Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
* plumbing/transport/internal: common, add support of Gogs for ↵Jerome Doucet2018-07-142-0/+83
| | | | | | ErrRepositoryNotFound, avoiding to get an 'unknown error: '. Add some tests for existing supported services (github, gitlab, etc...) too. Signed-off-by: Jerome Doucet <jerdct@gmail.com>
* *: add pointer to the new transport.Endpoint structMáximo Cuadros2017-11-211-4/+4
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Add sideband support for pushOri Rawlings2017-09-011-2/+16
|
* transport: context package supportMáximo Cuadros2017-07-252-11/+48
|
* transport/internal: read only first error lineSantiago M. Mola2017-07-071-17/+17
| | | | | | | We only use the first line of error output. So we use a channel with a single byte buffer and read the first line from stderr. Further output is discarded, as well as any further I/O error, which might be expected when closing the pipe (command finished).
* transport/internal: remove Wait function, use Close directlySantiago M. Mola2017-06-131-21/+5
|
* plumbing/transport: detect "access denied error"Santiago M. Mola2017-06-131-5/+10
| | | | | | | "ERR access denied or repository not exported:" is now detected as transport.ErrRepositoryNotFound, since that's what git-daemon returns when --informative-errors is not used.
* plumbing/transport: detect git protocol "no such repository" errorSantiago M. Mola2017-06-131-0/+5
|
* ensure receive-pack session is closed on push.Santiago M. Mola2017-06-131-1/+5
| | | | | | * at low level, ReceivePack must close its stream to the server to signal it has finished. * remote.go: Close() must be called on session.
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-072-8/+8
| | | | 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-281-5/+5
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-302-8/+8
|
* transport/http: fix partial request with haves. Fix #216. (#221)Antonio Navarro Perez2017-01-251-1/+1
|
* transport: remove SetAuth, fixes #206 (#210)Anthony Weems2017-01-171-14/+7
| | | | | * remove SetAuth functions, implement at NewUploadPackSession/NewReceivePackSession level. * propagate transport.Auth from Fetch/Pull/Clone options to the transport API.
* server: add git server implementation (#190)Santiago M. Mola2017-01-042-14/+86
| | | | | | | | | | | | | | | * server: add generic server implementation (transport-independent), both for git-upload-pack and git-receive-pack. * server: move internal functions to internal/common. * cli: add git-receive-pack and git-upload-pack implementations. * format/packfile: add UpdateObjectStorage function, extracted from Remote. * transport: implement tranport RPC-like, only with git-upload-pack and git-receive-pack methods. Client renamed to Transport. * storer: add storer.Storer interface. * protocol/packp: add UploadPackResponse constructor with packfile. * protocol/packp: fix UploadPackResponse encoding, add tests. * protocol/packp/capability: implement All.
* remote: add Push (#178)Santiago M. Mola2016-12-191-2/+2
| | | | | | | | | | | | * remote: add Push. * add Push method to Remote. * add method Push to Repository. * examples: add push example. * requested changes * add tests, fixes
* transport: new git protocol (#175)Máximo Cuadros2016-12-121-32/+59
|
* transport: add git-send-pack support to local/ssh. (#163)Santiago M. Mola2016-12-091-9/+46
| | | | | | | | | * protocol/packp: add Packfile field to ReferenceUpdateRequest. * protocol/packp: add NewReferenceUpdateRequestFromCapabilities. * NewReferenceUpdateRequestFromCapabilities can be used to create a ReferenceUpdateRequest with initial capabilities compatible with the server. * protocol/packp: fix new line handling on report status. * transport/file: test error on unexisting command.
* plumbing/transport: allow AdvertisedReferences being called multiple times. ↵Santiago M. Mola2016-12-081-12/+9
| | | | | | | | (#165) * AdvertisedReferences is now part of transport.Session. * It is allowed to be called more than once. * It is allowed to be called before and after FetchPack/SendPack. * Implementations cache its result.
* revision based on goreportcard.comMáximo Cuadros2016-12-061-1/+0
|
* protocol/packp: UploadPackResponse implementation (#161)Máximo Cuadros2016-12-061-21/+11
| | | | | | | | | | | | | | | | * plumbing/protocol: paktp avoid duplication of haves, wants and shallow * protocol/pakp: UploadPackResponse implementation * changes * changes * changes * debug * changes
* transport/internal: error handling fixes and clean up (#160)Santiago M. Mola2016-12-061-21/+92
| | | | | | | | | | | | | | | | | | | | * protocol/packp: remove redundant isFlush check on AdvRefs. * protocol/packp: improve AdvRefs documentation. * transport: improve error handling for non-existing repos. * protocol/packp: AdvRefs Decode now returns different errors for empty, but syntactically correct, AdvRefs message (ErrEmptyAdvRefs) and empty input (ErrEmptyInput). * transport/internal/common: read stderr only when needed (ErrEmptyInput). Close the client gracefully. * transport/internal/common: missing stderr on non existing repository does not block. * transport/internal/common: buffer error messages. * transport/file: fix changing binary name, add tests. * transport/file: support changing git-upload-pack and git-receive-pack binary names. * transport/file: add tests for misbehaving servers. * transport/internal/common: remove Stderr field. * transport/internal/common: do not close twice.
* capabilities: full integration (#151)Máximo Cuadros2016-12-011-0/+5
| | | | | | | | | | | | | | | | | | * format/pktline: fix readPayloadLen err handling * protocol/pakp: UploadReq validation and creation of capabilities * protocol/pakp: AdvRef tests * protocol/pakp: capability.List.Delete * protocol: filter unsupported capabilities * remote capability negociation * transport: UploadRequest validation * requested changes
* transport: add local transport (#145)Santiago M. Mola2016-11-291-0/+295
* transport: move common packp protocol out of ssh transport. * fixtures: add fixture for empty repository. * transport: add file:// transport