예제 #1
0
 public void AdvertiseUploadPack(Stream output)
 {
     using (var repository = GetRepository()) {
         var pack = new UploadPack(repository);
         pack.sendAdvertisedRefs(new RefAdvertiser.PacketLineOutRefAdvertiser(new PacketLineOut(output)));
     }
 }
예제 #2
0
        public static void AdvertiseUploadPack(string path, Stream output)
        {
            var repositoryPath = RepositoryPath.Resolve(path);

            var repository =
                Directory.Exists(path)
                    ? new Repository(repositoryPath.AbsoluteRootPath)
                    : Repository.Init(repositoryPath.AbsoluteRootPath);

            using (repository)
            {
                var pack = new UploadPack(repository);

                pack.sendAdvertisedRefs(
                    new RefAdvertiser.PacketLineOutRefAdvertiser(
                        new PacketLineOut(output)));
            }
        }