Skip to content

Commit 7a8394f

Browse files
committed
added test project
1 parent e4960c4 commit 7a8394f

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ _ReSharper*/
4040
_NCrunch_LibGit2Sharp/
4141
packages/
4242
worktree.playlist
43+
44+
.idea/
45+
run/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<AssemblyName>native-test</AssemblyName>
6+
<!-- <TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks> -->
7+
<LangVersion>8</LangVersion>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\LibGit2Sharp\LibGit2Sharp.csproj" />
12+
</ItemGroup>
13+
14+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30114.105
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibGit2Sharp.LoadTest", "LibGit2Sharp.LoadTest.csproj", "{E51C6010-EDD3-4213-BE16-34BD63A77204}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibGit2Sharp", "..\LibGit2Sharp\LibGit2Sharp.csproj", "{CF14BDB7-7730-41C0-9838-1554FB54C049}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(SolutionProperties) = preSolution
16+
HideSolutionNode = FALSE
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{E51C6010-EDD3-4213-BE16-34BD63A77204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{E51C6010-EDD3-4213-BE16-34BD63A77204}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{E51C6010-EDD3-4213-BE16-34BD63A77204}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{E51C6010-EDD3-4213-BE16-34BD63A77204}.Release|Any CPU.Build.0 = Release|Any CPU
23+
{CF14BDB7-7730-41C0-9838-1554FB54C049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{CF14BDB7-7730-41C0-9838-1554FB54C049}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{CF14BDB7-7730-41C0-9838-1554FB54C049}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{CF14BDB7-7730-41C0-9838-1554FB54C049}.Release|Any CPU.Build.0 = Release|Any CPU
27+
EndGlobalSection
28+
EndGlobal

LibGit2Sharp.LoadTest/Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.IO;
3+
using System.Reflection;
4+
using LibGit2Sharp;
5+
6+
internal class Program
7+
{
8+
private static void Main(string[] args)
9+
{
10+
var path = Assembly.GetExecutingAssembly().Location;
11+
string gitRepoPath;
12+
13+
// get the path to the git repo
14+
do
15+
{
16+
gitRepoPath = Path.Combine(path, ".git");
17+
path = Directory.GetParent(path)!.FullName;
18+
} while (!Directory.Exists(gitRepoPath));
19+
20+
using var repo = new Repository(gitRepoPath);
21+
Console.WriteLine(GlobalSettings.Version.LibGit2CommitSha);
22+
Console.WriteLine(repo.Head.FriendlyName);
23+
}
24+
}

0 commit comments

Comments
 (0)