Пример #1
0
 public void Receive(Stream inputStream, Stream outputStream)
 {
     using (var repository = GetRepository()) {
         var pack = new ReceivePack(repository);
         pack.setBiDirectionalPipe(false);
         pack.receive(inputStream, outputStream, outputStream);
     }
 }
Пример #2
0
        public static void Receive(string path, Stream input, Stream output)
        {
            var repositoryPath = RepositoryPath.Resolve(path);

            using (var repository = new Repository(repositoryPath.AbsoluteRootPath))
            {
                var pack = new ReceivePack(repository);
                pack.setBiDirectionalPipe(false);
                pack.receive(input, output, output);
            }
        }
Пример #3
0
        public void Receive(Stream inputStream, Stream outputStream)
        {
            using (var repository = GetRepository()) {
                var pack = new ReceivePack(repository);
                pack.setBiDirectionalPipe(false);

                if (PostRecieveHook != null)
                {
                    pack.setPostReceiveHook(PostRecieveHook);
                }

                pack.receive(inputStream, outputStream, outputStream);
            }
        }
Пример #4
0
        private ActionResult ExecuteReceivePack(string project)
        {
            Response.ContentType = "application/x-git-receive-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 ReceivePack(repository))
                    {
                        pack.setBiDirectionalPipe(false);
                        pack.receive(GetInputStream(), Response.OutputStream, Response.OutputStream);
                    }

                return(new EmptyResult());
            }
            else
            {
                return(new HttpNotFoundResult());
            }
        }