Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Libgit2sharp
提交
138ac02a
L
Libgit2sharp
项目概览
jobily
/
Libgit2sharp
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
Libgit2sharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
138ac02a
编写于
12月 09, 2010
作者:
N
nulltoken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed EpochHelper to Epoch.
上级
98157253
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
8 deletion
+22
-8
libgit2sharp.Tests/EpochFixture.cs
libgit2sharp.Tests/EpochFixture.cs
+3
-3
libgit2sharp.Tests/RepositoryFixtures.cs
libgit2sharp.Tests/RepositoryFixtures.cs
+1
-1
libgit2sharp.Tests/libgit2sharp.Tests.csproj
libgit2sharp.Tests/libgit2sharp.Tests.csproj
+1
-1
libgit2sharp/Epoch.cs
libgit2sharp/Epoch.cs
+14
-0
libgit2sharp/Wrapper/git_commit.cs
libgit2sharp/Wrapper/git_commit.cs
+1
-1
libgit2sharp/Wrapper/git_person.cs
libgit2sharp/Wrapper/git_person.cs
+1
-1
libgit2sharp/libgit2sharp.csproj
libgit2sharp/libgit2sharp.csproj
+1
-1
未找到文件。
libgit2sharp.Tests/Epoch
Helper
Fixture.cs
→
libgit2sharp.Tests/EpochFixture.cs
浏览文件 @
138ac02a
...
...
@@ -4,13 +4,13 @@
namespace
libgit2sharp.Tests
{
[
TestFixture
]
public
class
Epoch
Helper
Fixture
public
class
EpochFixture
{
[
TestCase
(
0
)]
[
TestCase
(
17
)]
public
void
ToDateDateTimeOffset_ShouldReturnAUtcBasedDateTimeOffset
(
Int32
secondsSinceEpoch
)
{
DateTimeOffset
when
=
Epoch
Helper
.
ToDateTimeOffset
(
secondsSinceEpoch
);
DateTimeOffset
when
=
Epoch
.
ToDateTimeOffset
(
secondsSinceEpoch
);
Assert
.
AreEqual
(
TimeSpan
.
Zero
,
when
.
Offset
);
Assert
.
AreEqual
(
DateTimeKind
.
Utc
,
when
.
UtcDateTime
.
Kind
);
}
...
...
@@ -20,7 +20,7 @@ public void ToDateDateTimeOffset_ShouldReturnAUtcBasedDateTimeOffset(Int32 secon
[
TestCase
(
1288114383
,
"Tue, 26 Oct 2010 17:33:03 GMT"
)]
public
void
ToDateDateTimeOffset_ShouldCorrectlyConvert
(
Int32
secondsSinceEpoch
,
string
expected
)
{
DateTimeOffset
when
=
Epoch
Helper
.
ToDateTimeOffset
(
secondsSinceEpoch
);
DateTimeOffset
when
=
Epoch
.
ToDateTimeOffset
(
secondsSinceEpoch
);
var
expectedDate
=
DateTimeOffset
.
Parse
(
expected
);
Assert
.
AreEqual
(
expectedDate
,
when
);
}
...
...
libgit2sharp.Tests/RepositoryFixtures.cs
浏览文件 @
138ac02a
...
...
@@ -155,7 +155,7 @@ private static void AssertTag0c37a53(string objectId, Tag tag)
Assert
.
AreEqual
(
"v1.0"
,
tag
.
Name
);
Assert
.
AreEqual
(
"schacon@gmail.com"
,
tag
.
Tagger
.
Email
);
Assert
.
AreEqual
(
"test tag message\n"
,
tag
.
Message
);
Assert
.
AreEqual
(
Epoch
Helper
.
ToDateTimeOffset
(
1288114383
),
tag
.
Tagger
.
Time
);
Assert
.
AreEqual
(
Epoch
.
ToDateTimeOffset
(
1288114383
),
tag
.
Tagger
.
Time
);
Assert
.
AreEqual
(
"5b5b025afb0b4c913b4c338a42934a3863bf3644"
,
tag
.
Target
.
Id
);
}
...
...
libgit2sharp.Tests/libgit2sharp.Tests.csproj
浏览文件 @
138ac02a
...
...
@@ -43,7 +43,7 @@
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Epoch
Helper
Fixture.cs"
/>
<Compile
Include=
"EpochFixture.cs"
/>
<Compile
Include=
"ObjectIdFixture.cs"
/>
<Compile
Include=
"RepositoryFixtures.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
...
...
libgit2sharp/Epoch
Helper
.cs
→
libgit2sharp/Epoch.cs
浏览文件 @
138ac02a
...
...
@@ -2,13 +2,13 @@
namespace
libgit2sharp
{
public
static
class
Epoch
Helper
public
static
class
Epoch
{
p
ublic
static
readonly
DateTimeOffset
Epoch
=
new
DateTimeOffset
(
1970
,
1
,
1
,
0
,
0
,
0
,
TimeSpan
.
Zero
);
p
rivate
static
readonly
DateTimeOffset
EpochDateTimeOffset
=
new
DateTimeOffset
(
1970
,
1
,
1
,
0
,
0
,
0
,
TimeSpan
.
Zero
);
public
static
DateTimeOffset
ToDateTimeOffset
(
Int32
secondsSinceEpoch
)
{
return
Epoch
.
AddSeconds
(
secondsSinceEpoch
);
return
Epoch
DateTimeOffset
.
AddSeconds
(
secondsSinceEpoch
);
}
}
}
\ No newline at end of file
libgit2sharp/Wrapper/git_commit.cs
浏览文件 @
138ac02a
...
...
@@ -36,7 +36,7 @@ internal Commit Build()
var
gitTree
=
(
git_tree
)
Marshal
.
PtrToStructure
(
tree
,
typeof
(
git_tree
));
Tree
commitTree
=
gitTree
.
Build
();
return
new
Commit
(
ObjectId
.
ToString
(
commit
.
id
.
id
),
commitAuthor
,
commitCommitter
,
Epoch
Helper
.
ToDateTimeOffset
((
int
)
time
),
message
,
message_short
,
commitTree
);
return
new
Commit
(
ObjectId
.
ToString
(
commit
.
id
.
id
),
commitAuthor
,
commitCommitter
,
Epoch
.
ToDateTimeOffset
((
int
)
time
),
message
,
message_short
,
commitTree
);
}
}
}
libgit2sharp/Wrapper/git_person.cs
浏览文件 @
138ac02a
...
...
@@ -16,7 +16,7 @@ internal struct git_person
internal
Person
Build
()
{
return
new
Person
(
name
,
email
,
Epoch
Helper
.
ToDateTimeOffset
((
int
)
time
));
return
new
Person
(
name
,
email
,
Epoch
.
ToDateTimeOffset
((
int
)
time
));
}
}
}
\ No newline at end of file
libgit2sharp/libgit2sharp.csproj
浏览文件 @
138ac02a
...
...
@@ -42,7 +42,7 @@
<ItemGroup>
<Compile
Include=
"Blob.cs"
/>
<Compile
Include=
"Commit.cs"
/>
<Compile
Include=
"Epoch
Helper
.cs"
/>
<Compile
Include=
"Epoch.cs"
/>
<Compile
Include=
"IObjectHeaderReader.cs"
/>
<Compile
Include=
"IResolver.cs"
/>
<Compile
Include=
"ObjectId.cs"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录