aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file
Commit message (Collapse)AuthorAgeFilesLines
* *: upgrade to go-billy.v3, mergeMáximo Cuadros2017-06-183-7/+8
|
* transport/internal: remove Wait function, use Close directlySantiago M. Mola2017-06-131-5/+12
|
* do not convert local paths to URLSantiago M. Mola2017-04-284-17/+11
| | | | | | | * Do not convert local paths to URLs, just keep them as they are. * This way we add support for Windows without taking care of Windows path-to-URL conversion.
* transport: make Endpoint an interface, fixes #362Santiago M. Mola2017-04-271-1/+1
| | | | | * add internal *url.URL implementation for regular URLs. * add internal implementation for SCP-like URLs.
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-075-10/+10
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* transport/file: fix race condition on test (#267)Alberto Cortés2017-02-151-45/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, the `TestClone` and `TestPush` tests of `transport/file` fail in travis. This is due to a race condition caused by an incorrect usage of `Cmd.Wait()` while reading from the output and error pipes of the command. This patch fixes the problem by using `Cmd.CombinedOutput()` instead of calling `Cmd.Start()` and `Cmd.Wait()` while reading from the output and error pipes. Details: From the `exec` package documentation: ``` Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves; however, an implication is that it is incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to call Run when using StdoutPipe. ``` In our tests, the old `execAndGetOutput` function was creating two gorutines to read from the stderr and stdout pipes of the command and then call `Wait` on the command. This caused a race condition: when the `Wait` call finished before the gorutines have read from the pipes, they returned caused an error on `outErr`. The problem only happens sometimes on travis. To reproduce the problem locally, just add a call to time.Sleep(time.Second) to the gorutine before its `ioutil.ReadAll` call to delay them, then `Wait` will always finish before them, closing the pipes, and the gorutines will fail. The returned error detected by the test will be: ``` FAIL: server_test.go:55: ServerSuite.TestClone server_test.go:65: c.Assert(err, IsNil, Commentf("STDOUT:\n%s\nSTDERR:\n%s\n", stdout, stderr)) ... value *os.PathError = &os.PathError{Op:"read", Path:"|0", Err:0x9} ("read |0: bad file descriptor") ... STDOUT: STDERR: ```
* transport/file: delete suite tmp dir at teardown (#266)Alberto Cortés2017-02-131-5/+12
| | | | | | | | | | | The transport/file common suite test generates a temporal directory; It is used to store the go-git client command and some links to it: git-upload-pack and git-receive-pack. This directory is not deleted at the test teardown, so every time we run a test, we pollute "/tmp". This patch adds a teardown function for the suite that deletes the temporal directory. It also calls the teardown of the embedded fixtures.Suite, which is probably what we want also. I have also simplify the call to ioutil.TempDir as it already uses the default tmp dir if no dir is provided.
* package plumbing documentation improvements (#248)Máximo Cuadros2017-02-071-0/+1
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-305-10/+10
|
* new git fixture pathMáximo Cuadros2017-01-304-4/+4
|
* transport: remove SetAuth, fixes #206 (#210)Anthony Weems2017-01-174-17/+16
| | | | | * 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-047-65/+249
| | | | | | | | | | | | | | | * 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.
* transport: add git-send-pack support to local/ssh. (#163)Santiago M. Mola2016-12-094-0/+124
| | | | | | | | | * 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.
* transport/internal: error handling fixes and clean up (#160)Santiago M. Mola2016-12-062-0/+36
| | | | | | | | | | | | | | | | | | | | * 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.
* transport: add local transport (#145)Santiago M. Mola2016-11-293-0/+129
* transport: move common packp protocol out of ssh transport. * fixtures: add fixture for empty repository. * transport: add file:// transport