Skip to content

Commit 435b39d

Browse files
committed
create core namespace to hide away advanced internals
1 parent 2499ea2 commit 435b39d

28 files changed

+51
-35
lines changed

LibGit2Sharp.Tests/CommitFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using LibGit2Sharp.Core;
45
using NUnit.Framework;
56

67
namespace LibGit2Sharp.Tests

LibGit2Sharp.Tests/EpochFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using LibGit2Sharp.Core;
23
using NUnit.Framework;
34

45
namespace LibGit2Sharp.Tests

LibGit2Sharp.Tests/ObjectIdFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NUnit.Framework;
1+
using LibGit2Sharp.Core;
2+
using NUnit.Framework;
23

34
namespace LibGit2Sharp.Tests
45
{

LibGit2Sharp.Tests/TagFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.Linq;
5+
using LibGit2Sharp.Core;
56
using NUnit.Framework;
67

78
namespace LibGit2Sharp.Tests

LibGit2Sharp/BranchCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using System.Globalization;
55
using System.Linq;
6+
using LibGit2Sharp.Core;
67

78
namespace LibGit2Sharp
89
{

LibGit2Sharp/Commit.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
56
{

LibGit2Sharp/CommitCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4+
using LibGit2Sharp.Core;
45

56
namespace LibGit2Sharp
67
{

LibGit2Sharp/Ensure.cs renamed to LibGit2Sharp/Core/Ensure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
/// <summary>
66
/// Ensure input parameters
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
using System;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
public static class Epoch
66
{
7-
private static readonly DateTimeOffset EpochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
7+
private static readonly DateTimeOffset epochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
88

99
public static DateTimeOffset ToDateTimeOffset(long secondsSinceEpoch, int timeZoneOffsetInMinutes)
1010
{
11-
var utcDateTime = EpochDateTimeOffset.AddSeconds(secondsSinceEpoch);
11+
var utcDateTime = epochDateTimeOffset.AddSeconds(secondsSinceEpoch);
1212
var offset = TimeSpan.FromMinutes(timeZoneOffsetInMinutes);
1313
return new DateTimeOffset(utcDateTime.DateTime.Add(offset), offset);
1414
}
1515

1616
public static Int32 ToSecondsSinceEpoch(this DateTimeOffset date)
1717
{
1818
var utcDate = date.ToUniversalTime();
19-
return (Int32) utcDate.Subtract(EpochDateTimeOffset).TotalSeconds;
19+
return (Int32) utcDate.Subtract(epochDateTimeOffset).TotalSeconds;
2020
}
2121
}
2222
}

LibGit2Sharp/GitErrorCode.cs renamed to LibGit2Sharp/Core/GitErrorCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp.Core
22
{
33
public enum GitErrorCode
44
{

LibGit2Sharp/GitObjectTypeMap.cs renamed to LibGit2Sharp/Core/GitObjectTypeMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace LibGit2Sharp
4+
namespace LibGit2Sharp.Core
55
{
66
public class GitObjectTypeMap : Dictionary<Type, GitObjectType>
77
{

LibGit2Sharp/GitOid.cs renamed to LibGit2Sharp/Core/GitOid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Runtime.InteropServices;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
/// <summary>
66
/// Represents a unique id in git which is the sha1 hash of this id's content.

LibGit2Sharp/GitReferenceType.cs renamed to LibGit2Sharp/Core/GitReferenceType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
[Flags]
66
public enum GitReferenceType

LibGit2Sharp/GitSignature.cs renamed to LibGit2Sharp/Core/GitSignature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Runtime.InteropServices;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
[StructLayout(LayoutKind.Sequential)]
66
public class GitSignature

LibGit2Sharp/GitTime.cs renamed to LibGit2Sharp/Core/GitTime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Runtime.InteropServices;
22

3-
namespace LibGit2Sharp
3+
namespace LibGit2Sharp.Core
44
{
55
[StructLayout(LayoutKind.Sequential)]
66
public class GitTime

LibGit2Sharp/NativeMethods.cs renamed to LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Runtime.InteropServices;
33

4-
namespace LibGit2Sharp
4+
namespace LibGit2Sharp.Core
55
{
66
internal class NativeMethods
77
{

LibGit2Sharp/UnSafeNativeMethods.cs renamed to LibGit2Sharp/Core/UnSafeNativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Runtime.InteropServices;
33

4-
namespace LibGit2Sharp
4+
namespace LibGit2Sharp.Core
55
{
66
internal unsafe class UnSafeNativeMethods
77
{

LibGit2Sharp/GitObject.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
56
{

LibGit2Sharp/LibGit2Sharp.Net35.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@
5050
<Compile Include="BranchType.cs" />
5151
<Compile Include="Commit.cs" />
5252
<Compile Include="CommitCollection.cs" />
53+
<Compile Include="Core\Ensure.cs" />
54+
<Compile Include="Core\Epoch.cs" />
55+
<Compile Include="Core\GitErrorCode.cs" />
56+
<Compile Include="Core\GitObjectTypeMap.cs" />
57+
<Compile Include="Core\GitOid.cs" />
58+
<Compile Include="Core\GitReferenceType.cs" />
59+
<Compile Include="Core\GitSignature.cs" />
60+
<Compile Include="Core\GitTime.cs" />
61+
<Compile Include="Core\NativeMethods.cs" />
62+
<Compile Include="Core\UnSafeNativeMethods.cs" />
5363
<Compile Include="DirectReference.cs" />
54-
<Compile Include="Ensure.cs" />
55-
<Compile Include="Epoch.cs" />
56-
<Compile Include="GitErrorCode.cs" />
5764
<Compile Include="GitObject.cs" />
5865
<Compile Include="GitObjectType.cs" />
59-
<Compile Include="GitObjectTypeMap.cs" />
60-
<Compile Include="GitOid.cs" />
61-
<Compile Include="GitReferenceType.cs" />
62-
<Compile Include="GitSignature.cs" />
6366
<Compile Include="GitSortOptions.cs" />
64-
<Compile Include="GitTime.cs" />
65-
<Compile Include="NativeMethods.cs" />
6667
<Compile Include="ObjectId.cs" />
6768
<Compile Include="Properties\AssemblyInfo.cs" />
6869
<Compile Include="Reference.cs" />
@@ -76,7 +77,6 @@
7677
<Compile Include="Tag.cs" />
7778
<Compile Include="TagCollection.cs" />
7879
<Compile Include="Tree.cs" />
79-
<Compile Include="UnSafeNativeMethods.cs" />
8080
</ItemGroup>
8181
<ItemGroup>
8282
<None Include="..\Lib\git2.lib">

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@
5151
<Compile Include="Commit.cs" />
5252
<Compile Include="CommitCollection.cs" />
5353
<Compile Include="DirectReference.cs" />
54-
<Compile Include="Ensure.cs" />
55-
<Compile Include="Epoch.cs" />
56-
<Compile Include="GitErrorCode.cs" />
54+
<Compile Include="Core\Ensure.cs" />
55+
<Compile Include="Core\Epoch.cs" />
56+
<Compile Include="Core\GitErrorCode.cs" />
5757
<Compile Include="GitObject.cs" />
5858
<Compile Include="GitObjectType.cs" />
59-
<Compile Include="GitObjectTypeMap.cs" />
60-
<Compile Include="GitOid.cs" />
61-
<Compile Include="GitReferenceType.cs" />
62-
<Compile Include="GitSignature.cs" />
63-
<Compile Include="GitTime.cs" />
59+
<Compile Include="Core\GitObjectTypeMap.cs" />
60+
<Compile Include="Core\GitOid.cs" />
61+
<Compile Include="Core\GitReferenceType.cs" />
62+
<Compile Include="Core\GitSignature.cs" />
63+
<Compile Include="Core\GitTime.cs" />
6464
<Compile Include="GitSortOptions.cs" />
65-
<Compile Include="NativeMethods.cs" />
65+
<Compile Include="Core\NativeMethods.cs" />
6666
<Compile Include="ObjectId.cs" />
6767
<Compile Include="Properties\AssemblyInfo.cs" />
6868
<Compile Include="Reference.cs" />
@@ -74,7 +74,7 @@
7474
<Compile Include="Tag.cs" />
7575
<Compile Include="TagCollection.cs" />
7676
<Compile Include="Tree.cs" />
77-
<Compile Include="UnSafeNativeMethods.cs" />
77+
<Compile Include="Core\UnSafeNativeMethods.cs" />
7878
</ItemGroup>
7979
<ItemGroup>
8080
<None Include="..\Lib\git2.lib">

LibGit2Sharp/ObjectId.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text;
2+
using LibGit2Sharp.Core;
23

34
namespace LibGit2Sharp
45
{

LibGit2Sharp/Reference.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
56
{

LibGit2Sharp/ReferenceCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4+
using LibGit2Sharp.Core;
45

56
namespace LibGit2Sharp
67
{

LibGit2Sharp/Repository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using LibGit2Sharp.Core;
45

56
namespace LibGit2Sharp
67
{

LibGit2Sharp/RepositorySafeHandle.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.Win32.SafeHandles;
1+
using LibGit2Sharp.Core;
2+
using Microsoft.Win32.SafeHandles;
23

34
namespace LibGit2Sharp
45
{

LibGit2Sharp/Signature.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
56
{

LibGit2Sharp/Tag.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
56
{

LibGit2Sharp/TagCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Linq;
5+
using LibGit2Sharp.Core;
56

67
namespace LibGit2Sharp
78
{

0 commit comments

Comments
 (0)