| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
plumbing/transport: git, error on empty SSH_AUTH_SOCK
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
```
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* remove SetAuth functions, implement at NewUploadPackSession/NewReceivePackSession level.
* propagate transport.Auth from Fetch/Pull/Clone options to the transport API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
* add Push method to Remote.
* add method Push to Repository.
* examples: add push example.
* requested changes
* add tests, fixes
|
|
|
|
|
|
|
|
|
|
| |
* packfile: delta selection logic
- Implemented logic to assign deltas to objects
* Requested changes
* Improved tests and fix errors
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
(#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.
|
|
|
|
|
|
| |
* remote: sideband support
* changes
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* plumbing/protocol: paktp avoid duplication of haves, wants and shallow
* protocol/pakp: UploadPackResponse implementation
* changes
* changes
* changes
* debug
* changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
| |
improvements (#144)
* protocol/pakp: capabilities new Capability entity and List struct, test improvements
* etc: example cloud-config file
* removing sorting from List.String
|
|
|
|
|
| |
* transport: move common packp protocol out of ssh transport.
* fixtures: add fixture for empty repository.
* transport: add file:// transport
|
|
|
|
|
|
|
|
|
|
| |
* protocol: move UploadPackRequest to protocol.
* UploadPackRequest is now defined as an embedding of UploadRequest and
UploadHaves.
* Move http encoding specific code from UploadPackRequest to transport/http.
* rename UlReq to UploadRequest
* packp: move AdvRefs Encoder/Decoder to Encode/Decode methods.
* packp: move UploadRequest Encoder/Decoder to Encode/Decode methods.
* packp: Remove transport.UploadPackInfo in favor of packp. AdvRefs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* move: format/packp -> protocol/packp
* format/packp -> protocol/packp
* format/packp/pktline -> format/pktline.
* move: protocol/packp/ulreq/* -> protocol/packp/*
* protocol/packp: rename UlReq types to make them unique.
* * protocol/packp: namespace UlReq encoder.
* protocol/packp: namespace UlReq decoder.
* protocol/packp: fix example names
* move: protocol/packp/advrefs/* -> protocol/packp/*
* further ulreq namespacing
* protocol/packp: namespace AdvRefs types.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* plumbing/transport: add common tests and fixes.
* add common test suite for different transport implementations.
* fix different behaviour on error handling for ssh and http.
fixes issue #123.
* support detecting unexisting repositories with SSH + GitHub/Bitbucket
(apparently, there is no standard for all SSH servers).
* remove ssh.NewClient (only DefaultClient makes sense at the moment).
* make ssh.Client and http.Client private.
* utils/ioutil: utilities to work with io interfaces.
* * transport: test actual objects fetched, not just packfile size.
* * fix doc typo.
* * improve UploadPackRequest.IsEmpty
|
|
* plumbing: move plumbing/client package to plumbing/transport.
* transport: create Client interface.
* A Client can instantiate any client transport service.
* InstallProtocol installs a Client for a given protocol,
instead of just a UploadPackService.
* A Client can open a session for fetch-pack or send-pack
for a specific Endpoint.
* Adapt ssh and http clients to the new client interface.
* updated doc
|