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 static void Upload(string path, Stream input, Stream output) { var repositoryPath = RepositoryPath.Resolve(path); using (var repository = new Repository(repositoryPath.AbsoluteRootPath)) { var pack = new UploadPack(repository); pack.setBiDirectionalPipe(false); pack.Upload(input, output, output); } }
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()); } }