MCPcopy Create free account
hub / github.com/libgit2/git2go / newChannelPipe

Function newChannelPipe

remote_test.go:261–277  ·  view source on GitHub ↗
(t *testing.T, w io.Writer, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

259}
260
261func newChannelPipe(t *testing.T, w io.Writer, wg *sync.WaitGroup) (*os.File, error) {
262 pr, pw, err := os.Pipe()
263 if err != nil {
264 return nil, err
265 }
266
267 wg.Add(1)
268 go func() {
269 _, err := io.Copy(w, pr)
270 if err != nil && err != io.EOF {
271 t.Logf("Failed to copy: %v", err)
272 }
273 wg.Done()
274 }()
275
276 return pw, nil
277}
278
279func startSSHServer(t *testing.T, hostKey ssh.Signer, authorizedKeys []ssh.PublicKey) net.Listener {
280 t.Helper()

Callers 1

startSSHServerFunction · 0.85

Calls 2

CopyMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…