| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
transport/server: add asClient parameter
|
| |
| |
| |
| |
| |
| | |
server.NewClient returns a server that acts as a client.
This makes it working seamlessly when registering a server directly with
`client.InstallProtocol`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
Pipe returned by Command.StderrPipe() has a race with Read and
Command.Wait(). We use a io.Pipe() instead and ensure it is closed
after Wait().
|
|
|
|
|
|
|
| |
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/ssh: allow passing SSH options
|
| |
| |
| |
| |
| | |
A global *ssh.ClientConfig override can be set. It will be
use to override values of each SSH session.
|
| |
| |
| |
| |
| | |
Adds the possibility of passing options to SSH transport.
Options have the form of functions modifying ssh.ClientConfig.
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
"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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* at low level, ReceivePack must close its stream to the
server to signal it has finished.
* remote.go: Close() must be called on session.
|
| |
|
|
|
|
| |
Two endpoints are not equals between them, even if they were generated using the same url or path.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* add internal *url.URL implementation for regular URLs.
* add internal implementation for SCP-like URLs.
|
| |
|
|\
| |
| | |
transport: ssh, new DefaultAuthBuilder variable
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
To be able to fix #261 we will move again to gopkg.in before v4 stable release.
|
|\
| |
| | |
Remove TODOs from documentation
|
| | |
|
|/
|
|
|
|
|
| |
- Now the input of the method Objects inside revlist package is a slice of hashes instead of commits. Hashes can be from Blobs, Trees and Commits objects.
- ObjectStorer now is used to obtain the object content using hashes slice.
- This PR fix #222. Now a test into upload_pack_test.go file is not skipped anymore.
- Remove code from remote.go and server.go that is not necessary.
|
|\
| |
| | |
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.
|
| |
|
| |
|
| |
|
| |
|