
11 changed files with 277 additions and 76 deletions
-
1.gitignore
-
8GitCandy.Web/Git/GitService.cs
-
46GitCandy.Web/GitCandy.Web.csproj
-
86GitCandy.Web/Web.config
-
22GitCandy.Web/packages.config
-
13GitCandy.sln
-
24GitCandy/Configuration/UserConfiguration.cs
-
6Test/App.config
-
48Test/Program.cs
-
36Test/Properties/AssemblyInfo.cs
-
63Test/Test.csproj
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
|||
</startup> |
|||
</configuration> |
@ -0,0 +1,48 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using LibGit2Sharp; |
|||
using NewLife.Log; |
|||
|
|||
namespace Test |
|||
{ |
|||
class Program |
|||
{ |
|||
static void Main(String[] args) |
|||
{ |
|||
XTrace.UseConsole(); |
|||
|
|||
try |
|||
{ |
|||
Test1(); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
XTrace.WriteException(ex); |
|||
} |
|||
|
|||
Console.WriteLine("OK"); |
|||
Console.ReadLine(); |
|||
} |
|||
|
|||
static void Test1() |
|||
{ |
|||
//var remoteUrl = "https://gitee.com/NewLifeX/NewLife.Cube";
|
|||
var remoteUrl = "https://gitee.com/NewLifeX/GitCandy"; |
|||
var xx = "xx".GetFullPath(); |
|||
//if (Directory.Exists(xx)) Directory.Delete(xx, true);
|
|||
var p = xx; |
|||
if (!Directory.Exists(xx)) p = Repository.Init(xx, true); |
|||
using (var repo = new Repository(p)) |
|||
{ |
|||
repo.Network.Remotes.Add("origin", remoteUrl, "+refs/*:refs/*"); |
|||
|
|||
//var refs = repo.Network.ListReferences("origin").ToList();
|
|||
//XTrace.WriteLine("发现分支:{0}", refs.Select(e => e.TargetIdentifier));
|
|||
|
|||
//repo.Network.Fetch("origin", new[] { "master" });
|
|||
repo.Network.Fetch("origin", new string[0]); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// 有关程序集的一般信息由以下
|
|||
// 控制。更改这些特性值可修改
|
|||
// 与程序集关联的信息。
|
|||
[assembly: AssemblyTitle("Test")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("Test")] |
|||
[assembly: AssemblyCopyright("Copyright © 2019")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
|||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
|||
//请将此类型的 ComVisible 特性设置为 true。
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
|||
[assembly: Guid("f435002a-02cc-4a6b-85aa-994037667505")] |
|||
|
|||
// 程序集的版本信息由下列四个值组成:
|
|||
//
|
|||
// 主版本
|
|||
// 次版本
|
|||
// 生成号
|
|||
// 修订号
|
|||
//
|
|||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
|||
//通过使用 "*",如下所示:
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
@ -0,0 +1,63 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{F435002A-02CC-4A6B-85AA-994037667505}</ProjectGuid> |
|||
<OutputType>Exe</OutputType> |
|||
<RootNamespace>Test</RootNamespace> |
|||
<AssemblyName>Test</AssemblyName> |
|||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|||
<Deterministic>true</Deterministic> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>..\BinTest\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<Prefer32Bit>false</Prefer32Bit> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>..\BinTest\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<Prefer32Bit>false</Prefer32Bit> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="System.Data.DataSetExtensions" /> |
|||
<Reference Include="Microsoft.CSharp" /> |
|||
<Reference Include="System.Data" /> |
|||
<Reference Include="System.Net.Http" /> |
|||
<Reference Include="System.Xml" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Program.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="App.config" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<PackageReference Include="LibGit2Sharp"> |
|||
<Version>0.26.1</Version> |
|||
</PackageReference> |
|||
<PackageReference Include="NewLife.Core"> |
|||
<Version>8.4.2019.1109</Version> |
|||
</PackageReference> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
</Project> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue