Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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());
            }
        }