public Upload ( Stream input, Stream output, Stream messages ) : void | ||
input | Stream | /// raw input to read client commands from. Caller must ensure the /// input is buffered, otherwise read performance may suffer. /// |
output | Stream | /// response back to the Git network client, to write the pack /// data onto. Caller must ensure the output is buffered, /// otherwise write performance may suffer. /// |
messages | Stream | /// secondary "notice" channel to send additional messages out /// through. When run over SSH this should be tied back to the /// standard error channel of the command execution. For most /// other network connections this should be null. /// |
Результат | void |
public override void Execute(DaemonClient client, Repository db) { var rp = new UploadPack(db); Stream stream = client.Stream; rp.Upload(stream, null, null); }
public void Upload(Stream inputStream, Stream outputStream) { using (var repository = GetRepository()) { using (var pack = new UploadPack(repository)) { pack.setBiDirectionalPipe(false); pack.Upload(inputStream, outputStream, outputStream); } } }
public ActionResult UploadPack(string project) { return ExecuteRpc(project, Rpc.UploadPack, repository => { using (var pack = new UploadPack(repository)) { pack.setBiDirectionalPipe(false); pack.Upload(Request.InputStream, Response.OutputStream, Response.OutputStream); } }); }
public void UploadPack(string project) { Response.ContentType = "application/x-git-upload-pack-result"; WriteNoCache(); using (var repository = repositories.GetRepository(project)) using (var pack = new UploadPack(repository)) { pack.setBiDirectionalPipe(false); pack.Upload(Request.InputStream, Response.OutputStream, Response.OutputStream); } }
private ActionResult ExecuteUploadPack(string project) { Response.ContentType = "application/x-git-upload-pack-result"; SetNoCache(); var directory = GetDirectoryInfo(project); if (GitSharp.Repository.IsValid(directory.FullName, true)) { using (var repository = new GitSharp.Repository(directory.FullName)) using (var pack = new UploadPack(repository)) { pack.setBiDirectionalPipe(false); pack.Upload(GetInputStream(), Response.OutputStream, Response.OutputStream); } return new EmptyResult(); } else { return new HttpNotFoundResult(); } }
public override void Execute(DaemonClient client, Repository db) { var rp = new UploadPack(db); Stream stream = client.Stream; rp.Upload(stream, null, null); }
public InternalLocalFetchConnection( TransportLocal transport) : base(transport) { Repository dst; try { dst = new Repository(transport.remoteGitDir); } catch (IOException) { throw new TransportException(uri, "Not a Git directory"); } PipedInputStream out_r; PipedOutputStream out_w; try { in_r = new PipedInputStream(); in_w = new PipedOutputStream(in_r); out_r = new PipedInputStream(); out_w = new PipedOutputStream(out_r); } catch (IOException ex) { dst.Close(); throw new TransportException(uri, "Cannot connect pipes", ex); } worker = new Thread( () => { try { UploadPack rp = new UploadPack(dst); rp.Upload(out_r, in_w, null); } catch (IOException ex) { // Client side of the pipes should report the problem. ex.printStackTrace(); } catch (Exception ex) { // Clients side will notice we went away, and report. ex.printStackTrace(); } finally { try { out_r.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } dst.Close(); } }); worker.Name = "JGit-Upload-Pack"; worker.Start(); init(in_r, out_w); readAdvertisedRefs(); }
public InternalLocalFetchConnection(TransportLocal transport) : base(transport) { Repository dst; try { dst = new Repository(transport.remoteGitDir); } catch (IOException) { throw new TransportException(uri, "Not a Git directory"); } PipedInputStream out_r; PipedOutputStream out_w; try { in_r = new PipedInputStream(); in_w = new PipedOutputStream(in_r); out_r = new PipedInputStream(); out_w = new PipedOutputStream(out_r); } catch (IOException ex) { dst.Close(); throw new TransportException(uri, "Cannot connect pipes", ex); } worker = new Thread(() => { try { UploadPack rp = new UploadPack(dst); rp.Upload(out_r, in_w, null); } catch (IOException ex) { // Client side of the pipes should report the problem. ex.printStackTrace(); } catch (Exception ex) { // Clients side will notice we went away, and report. ex.printStackTrace(); } finally { try { out_r.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } dst.Close(); } }); worker.Name = "JGit-Upload-Pack"; worker.Start(); init(in_r, out_w); readAdvertisedRefs(); }
private static void HandleUploadPackPost(HttpContext context, GitRoute route) { context.Response.ContentType = "application/x-git-upload-pack-result"; var pack = new UploadPack(route.Repository); pack.setBiDirectionalPipe(false); pack.Upload(context.Request.InputStream, context.Response.OutputStream, context.Response.OutputStream); }