Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Libgit2sharp
提交
7fa704cb
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,体验更适合开发者的 AI 搜索 >>
提交
7fa704cb
编写于
7月 15, 2011
作者:
N
nulltoken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove trailing white spaces
上级
66cbcc0f
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
53 addition
and
56 deletion
+53
-56
BACKLOG.md
BACKLOG.md
+1
-2
CHANGELOG.md
CHANGELOG.md
+0
-1
CI-build.msbuild
CI-build.msbuild
+1
-1
LICENSE.md
LICENSE.md
+0
-1
LibGit2Sharp.Tests/BranchFixture.cs
LibGit2Sharp.Tests/BranchFixture.cs
+2
-2
LibGit2Sharp.Tests/CommitFixture.cs
LibGit2Sharp.Tests/CommitFixture.cs
+1
-1
LibGit2Sharp.Tests/IndexFixture.cs
LibGit2Sharp.Tests/IndexFixture.cs
+3
-3
LibGit2Sharp.Tests/Properties/AssemblyInfo.cs
LibGit2Sharp.Tests/Properties/AssemblyInfo.cs
+5
-5
LibGit2Sharp.Tests/ReferenceFixture.cs
LibGit2Sharp.Tests/ReferenceFixture.cs
+1
-1
LibGit2Sharp.Tests/RepositoryFixture.cs
LibGit2Sharp.Tests/RepositoryFixture.cs
+1
-1
LibGit2Sharp.Tests/TagFixture.cs
LibGit2Sharp.Tests/TagFixture.cs
+2
-2
LibGit2Sharp/BranchCollection.cs
LibGit2Sharp/BranchCollection.cs
+1
-1
LibGit2Sharp/CommitCollection.cs
LibGit2Sharp/CommitCollection.cs
+1
-1
LibGit2Sharp/Core/Ensure.cs
LibGit2Sharp/Core/Ensure.cs
+1
-1
LibGit2Sharp/Core/GitOid.cs
LibGit2Sharp/Core/GitOid.cs
+1
-1
LibGit2Sharp/Core/NativeMethods.cs
LibGit2Sharp/Core/NativeMethods.cs
+1
-1
LibGit2Sharp/Core/PosixPathHelper.cs
LibGit2Sharp/Core/PosixPathHelper.cs
+2
-2
LibGit2Sharp/DirectReference.cs
LibGit2Sharp/DirectReference.cs
+1
-1
LibGit2Sharp/GitObject.cs
LibGit2Sharp/GitObject.cs
+1
-1
LibGit2Sharp/GitObjectType.cs
LibGit2Sharp/GitObjectType.cs
+6
-6
LibGit2Sharp/Index.cs
LibGit2Sharp/Index.cs
+4
-4
LibGit2Sharp/ObjectId.cs
LibGit2Sharp/ObjectId.cs
+3
-3
LibGit2Sharp/Properties/AssemblyInfo.cs
LibGit2Sharp/Properties/AssemblyInfo.cs
+5
-5
LibGit2Sharp/ReferenceCollection.cs
LibGit2Sharp/ReferenceCollection.cs
+5
-5
LibGit2Sharp/Repository.cs
LibGit2Sharp/Repository.cs
+4
-4
未找到文件。
BACKLOG.md
浏览文件 @
7fa704cb
...
...
@@ -29,8 +29,7 @@
-
Add Reference equality test suite
-
Remove Ignore attribute from ReferenceFixture.CanMoveAReferenceToADeeperReferenceHierarchy() once git_reference_rename() is fixed
-
Remove Ignore attribute from ReferenceFixture.CanMoveAReferenceToAUpperReferenceHierarchy() once git_reference_rename() is fixed
### Miscellaneous
-
Run the build on a Unix platform
CHANGELOG.md
浏览文件 @
7fa704cb
...
...
@@ -70,4 +70,3 @@
## v0.1.0
-
Initial release
CI-build.msbuild
浏览文件 @
7fa704cb
...
...
@@ -35,7 +35,7 @@
Force32Bit="true"
OutputXmlFile="$(DeployFolder)\Test-result.xml" />
</Target>
<Target Name="Deploy" DependsOnTargets="Test">
<Copy SourceFiles="@(OutputFiles)"
DestinationFiles="@(OutputFiles->'$(DeployFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
...
...
LICENSE.md
浏览文件 @
7fa704cb
...
...
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
LibGit2Sharp.Tests/BranchFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -328,7 +328,7 @@ public void CanMoveABranchWhileOverwritingAnExistingOne()
newTest
.
Tip
.
ShouldEqual
(
br2
.
Tip
);
}
}
[
Test
]
public
void
CreatingABranchTriggersTheCreationOfADirectReference
()
{
...
...
@@ -337,7 +337,7 @@ public void CreatingABranchTriggersTheCreationOfADirectReference()
{
var
newBranch
=
repo
.
CreateBranch
(
"clone-of-master"
);
newBranch
.
IsCurrentRepositoryHead
.
ShouldBeFalse
();
var
commitId
=
repo
.
Head
.
Tip
.
Id
;
newBranch
.
Tip
.
Id
.
ShouldEqual
(
commitId
);
...
...
LibGit2Sharp.Tests/CommitFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -219,7 +219,7 @@ public void CanEnumerateUsingTwoAbbreviatedShasAsBoundaries()
CollectionAssert
.
AreEquivalent
(
new
[]
{
"a4a7dce"
,
"c47800c"
,
"9fd738e"
},
abbrevShas
);
}
}
[
Test
]
public
void
CanLookupCommitGeneric
()
{
...
...
LibGit2Sharp.Tests/IndexFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -16,7 +16,7 @@ public class IndexFixture : BaseFixture
"new.txt"
,
"branch_file.txt"
,
"1/branch_file.txt"
,
//"deleted_staged_file.txt",
//"deleted_staged_file.txt",
"deleted_unstaged_file.txt"
,
"modified_staged_file.txt"
,
"modified_unstaged_file.txt"
,
...
...
@@ -123,10 +123,10 @@ public void StagingANewVersionOfAFileThenUnstagingRevertsTheBlobToTheVersionOfHe
const
string
fileName
=
"myFile.txt"
;
var
fullpath
=
Path
.
Combine
(
repo
.
Info
.
WorkingDirectory
,
fileName
);
const
string
initialContent
=
"Hello?"
;
File
.
AppendAllText
(
fullpath
,
initialContent
);
repo
.
Index
.
Stage
(
fileName
);
var
blobId
=
repo
.
Index
[
fileName
].
Id
;
...
...
LibGit2Sharp.Tests/Properties/AssemblyInfo.cs
浏览文件 @
7fa704cb
using
System.Reflection
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
...
...
@@ -14,8 +14,8 @@
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[
assembly
:
ComVisible
(
false
)]
...
...
@@ -27,11 +27,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
...
...
LibGit2Sharp.Tests/ReferenceFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -436,7 +436,7 @@ public void CanMoveAndOverWriteAExistingReference()
{
const
string
oldName
=
"refs/heads/packed"
;
const
string
newName
=
"refs/heads/br2"
;
Reference
moved
=
repo
.
Refs
.
Move
(
oldName
,
newName
,
true
);
repo
.
Refs
[
oldName
].
ShouldBeNull
();
...
...
LibGit2Sharp.Tests/RepositoryFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -67,7 +67,7 @@ private void CheckGitConfigFile(string dir)
private
static
void
AssertIsHidden
(
string
repoPath
)
{
var
attribs
=
File
.
GetAttributes
(
repoPath
);
(
attribs
&
FileAttributes
.
Hidden
).
ShouldEqual
(
FileAttributes
.
Hidden
);
}
...
...
LibGit2Sharp.Tests/TagFixture.cs
浏览文件 @
7fa704cb
...
...
@@ -375,7 +375,7 @@ public void BlindlyCreatingAnAnnotatedTagOverAnExistingOneThrows()
Assert
.
Throws
<
ApplicationException
>(()
=>
repo
.
Tags
.
Create
(
"e90810b"
,
"refs/heads/br2"
,
signatureNtk
,
"a nice message"
));
}
}
[
Test
]
public
void
CreateTagWithADuplicateNameThrows
()
{
...
...
@@ -548,7 +548,7 @@ public void ListAllTagsShouldOutputThemInAnOrderedWay()
using
(
var
repo
=
new
Repository
(
Constants
.
BareTestRepoPath
))
{
List
<
string
>
tagNames
=
repo
.
Tags
.
Select
(
t
=>
t
.
Name
).
ToList
();
var
sortedTags
=
expectedTags
;
sortedTags
.
Sort
();
...
...
LibGit2Sharp/BranchCollection.cs
浏览文件 @
7fa704cb
...
...
@@ -87,7 +87,7 @@ public Branch Create(string name, string target)
var
reference
=
repo
.
Refs
[
NormalizeToCanonicalName
(
target
)].
ResolveToDirectReference
();
target
=
reference
.
TargetIdentifier
;
}
repo
.
Refs
.
Create
(
NormalizeToCanonicalName
(
name
),
target
);
return
this
[
name
];
}
...
...
LibGit2Sharp/CommitCollection.cs
浏览文件 @
7fa704cb
...
...
@@ -86,7 +86,7 @@ public ICommitCollection QueryBy(Filter filter)
return
new
CommitCollection
(
repo
,
filter
.
SortBy
)
{
includedIdentifier
=
filter
.
Since
,
includedIdentifier
=
filter
.
Since
,
excludedIdentifier
=
filter
.
Until
};
}
...
...
LibGit2Sharp/Core/Ensure.cs
浏览文件 @
7fa704cb
...
...
@@ -46,7 +46,7 @@ public static void ArgumentNotNullOrEmptyString(string argumentValue, string arg
/// </para>
/// </summary>
/// <param name = "result">The result to examine.</param>
/// <param name="allowPositiveResult">False to only allow success when comparing against 0,
/// <param name="allowPositiveResult">False to only allow success when comparing against 0,
/// True when positive values are allowed as well.</param>
public
static
void
Success
(
int
result
,
bool
allowPositiveResult
=
false
)
{
...
...
LibGit2Sharp/Core/GitOid.cs
浏览文件 @
7fa704cb
...
...
@@ -10,7 +10,7 @@ internal struct GitOid
/// <summary>
/// The raw binary 20 byte Id.
/// </summary>
[
MarshalAs
(
UnmanagedType
.
ByValArray
,
SizeConst
=
20
)]
[
MarshalAs
(
UnmanagedType
.
ByValArray
,
SizeConst
=
20
)]
public
byte
[]
Id
;
}
}
\ No newline at end of file
LibGit2Sharp/Core/NativeMethods.cs
浏览文件 @
7fa704cb
...
...
@@ -133,7 +133,7 @@ internal static class NativeMethods
public
static
extern
int
git_repository_discover
(
StringBuilder
repository_path
,
int
size
,
string
start_path
,
[
MarshalAs
(
UnmanagedType
.
Bool
)]
bool
across_fs
,
string
ceiling_dirs
);
[
DllImport
(
libgit2
)]
public
static
extern
void
git_repository_free
(
IntPtr
repository
);
...
...
LibGit2Sharp/Core/PosixPathHelper.cs
浏览文件 @
7fa704cb
...
...
@@ -11,8 +11,8 @@ public static string ToPosix(string nativePath)
if
(
posixDirectorySeparatorChar
==
Path
.
DirectorySeparatorChar
)
{
return
nativePath
;
}
}
if
(
nativePath
==
null
)
{
return
null
;
...
...
LibGit2Sharp/DirectReference.cs
浏览文件 @
7fa704cb
...
...
@@ -10,7 +10,7 @@ public class DirectReference : Reference
private
readonly
Func
<
GitObject
>
targetResolver
;
private
bool
resolved
;
private
GitObject
target
;
internal
DirectReference
(
Func
<
GitObject
>
targetResolver
)
{
this
.
targetResolver
=
targetResolver
;
...
...
LibGit2Sharp/GitObject.cs
浏览文件 @
7fa704cb
...
...
@@ -84,7 +84,7 @@ public override bool Equals(object obj)
{
return
Equals
(
obj
as
GitObject
);
}
/// <summary>
/// Determines whether the specified <see cref="GitObject"/> is equal to the current <see cref="GitObject"/>.
/// </summary>
...
...
LibGit2Sharp/GitObjectType.cs
浏览文件 @
7fa704cb
...
...
@@ -11,7 +11,7 @@ public enum GitObjectType
Any
=
-
2
,
/// <summary>
/// Object is invalid.
/// Object is invalid.
/// </summary>
Bad
=
-
1
,
...
...
@@ -24,27 +24,27 @@ public enum GitObjectType
/// A commit object.
/// </summary>
Commit
=
1
,
/// <summary>
/// A tree (directory listing) object.
/// </summary>
Tree
=
2
,
/// <summary>
/// A file revision object.
/// </summary>
Blob
=
3
,
/// <summary>
/// An annotated tag object.
/// </summary>
Tag
=
4
,
/// <summary>
/// Reserved for future use.
/// </summary>
Ext2
=
5
,
/// <summary>
/// A delta, base is given by an offset.
/// </summary>
...
...
LibGit2Sharp/Index.cs
浏览文件 @
7fa704cb
...
...
@@ -23,7 +23,7 @@ internal IndexSafeHandle Handle
{
get
{
return
handle
;
}
}
public
int
Count
{
get
{
return
(
int
)
NativeMethods
.
git_index_entrycount
(
handle
);
}
...
...
@@ -162,7 +162,7 @@ public void Move(string sourcePath, string destinationPath)
RemoveFromIndex
(
relativeSourcePath
);
File
.
Move
(
Path
.
Combine
(
wd
,
relativeSourcePath
),
Path
.
Combine
(
wd
,
relativeDestinationPath
));
AddToIndex
(
relativeDestinationPath
);
UpdatePhysicalIndex
();
...
...
@@ -190,7 +190,7 @@ private void RestorePotentialPreviousVersionOf(string relativePath)
{
return
;
}
File
.
WriteAllBytes
(
Path
.
Combine
(
repo
.
Info
.
WorkingDirectory
,
relativePath
),
((
Blob
)
currentHeadBlob
.
Target
).
Content
);
AddToIndex
(
relativePath
);
}
...
...
@@ -201,7 +201,7 @@ private void UpdatePhysicalIndex()
Ensure
.
Success
(
res
);
}
private
string
BuildRelativePathFrom
(
string
path
)
//TODO: To be removed when libgit2 natively implements this
private
string
BuildRelativePathFrom
(
string
path
)
//TODO: To be removed when libgit2 natively implements this
{
if
(!
Path
.
IsPathRooted
(
path
))
{
...
...
LibGit2Sharp/ObjectId.cs
浏览文件 @
7fa704cb
...
...
@@ -283,9 +283,9 @@ private static bool LooksValid(string objectId, bool throwIfInvalid, bool allowS
return
false
;
}
string
additionalErrorInformation
=
!
allowShortIdentifier
?
string
.
Format
(
"Its length should be {0}"
,
HexSize
)
:
string
additionalErrorInformation
=
!
allowShortIdentifier
?
string
.
Format
(
"Its length should be {0}"
,
HexSize
)
:
string
.
Format
(
"Its length should be comprised between {0} and {1}"
,
MinHexSize
,
HexSize
);
throw
new
ArgumentException
(
...
...
LibGit2Sharp/Properties/AssemblyInfo.cs
浏览文件 @
7fa704cb
...
...
@@ -2,7 +2,7 @@
using
System.Reflection
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
...
...
@@ -21,8 +21,8 @@
[
assembly
:
CLSCompliant
(
true
)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[
assembly
:
ComVisible
(
false
)]
...
...
@@ -34,11 +34,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
...
...
LibGit2Sharp/ReferenceCollection.cs
浏览文件 @
7fa704cb
...
...
@@ -71,7 +71,7 @@ public Reference Create(string name, string target, bool allowOverwrite = false)
Ensure
.
ArgumentNotNullOrEmptyString
(
target
,
"target"
);
ObjectId
id
;
IntPtr
reference
;
int
res
;
...
...
@@ -97,9 +97,9 @@ private int CreateSymbolicReference(string name, string target, bool allowOverwr
private
int
CreateDirectReference
(
string
name
,
ObjectId
targetId
,
bool
allowOverwrite
,
out
IntPtr
reference
)
{
targetId
=
Unabbreviate
(
targetId
);
GitOid
oid
=
targetId
.
Oid
;
return
NativeMethods
.
git_reference_create_oid
(
out
reference
,
repo
.
Handle
,
name
,
ref
oid
,
allowOverwrite
);
}
...
...
@@ -111,7 +111,7 @@ private ObjectId Unabbreviate(ObjectId targetId)
}
var
obj
=
repo
.
Lookup
(
targetId
);
if
(
obj
==
null
)
{
Ensure
.
Success
((
int
)
GitErrorCode
.
GIT_ENOTFOUND
);
...
...
@@ -147,7 +147,7 @@ public Reference Move(string currentName, string newName, bool allowOverwrite =
Ensure
.
ArgumentNotNullOrEmptyString
(
newName
,
"newName"
);
IntPtr
referencePtr
=
RetrieveReferencePtr
(
currentName
);
int
res
=
NativeMethods
.
git_reference_rename
(
referencePtr
,
newName
,
allowOverwrite
);
Ensure
.
Success
(
res
);
...
...
LibGit2Sharp/Repository.cs
浏览文件 @
7fa704cb
...
...
@@ -59,7 +59,7 @@ public Branch Head
get
{
Reference
headRef
=
Refs
[
"HEAD"
];
if
(
Info
.
IsEmpty
)
{
return
new
Branch
(
headRef
.
TargetIdentifier
,
null
,
this
);
...
...
@@ -86,7 +86,7 @@ public ReferenceCollection Refs
}
/// <summary>
/// Lookup and enumerate commits in the repository.
/// Lookup and enumerate commits in the repository.
/// Iterating this collection directly starts walking from the HEAD.
/// </summary>
public
IQueryableCommitCollection
Commits
...
...
@@ -146,7 +146,7 @@ protected virtual void Dispose(bool disposing)
/// <summary>
/// Tells if the specified sha exists in the repository.
///
///
/// Exceptions:
/// ArgumentException
/// ArgumentNullException
...
...
@@ -263,7 +263,7 @@ private static bool IsReferencePeelable(Reference reference)
/// <summary>
/// Probe for a git repository.
/// <para>The lookup start from <paramref name="startingPath"/> and walk upward parent directories if nothing has been found.</para>
/// <para>The lookup start from <paramref name="startingPath"/> and walk upward parent directories if nothing has been found.</para>
/// </summary>
/// <param name="startingPath">The base path where the lookup starts.</param>
/// <returns>The path to the git repository.</returns>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录