Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-06-10 15:41:05 +0400
committernulltoken <emeric.fermas@gmail.com>2011-06-10 22:19:55 +0400
commit1828200d3747300a40dcfbc18f20dd2a54f9cca4 (patch)
tree8c58fc6baa4c3363b913b54d0fc09eca11983ca1
parente12b3585f296e5a53541702807d58ef6e7678e00 (diff)
Update API to cope with some libgit2 minor changes
-rw-r--r--LibGit2Sharp/Core/NativeMethods.cs6
-rw-r--r--LibGit2Sharp/Index.cs6
-rw-r--r--LibGit2Sharp/Tree.cs4
3 files changed, 8 insertions, 8 deletions
diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs
index 25192f00..4a3c421f 100644
--- a/LibGit2Sharp/Core/NativeMethods.cs
+++ b/LibGit2Sharp/Core/NativeMethods.cs
@@ -56,7 +56,7 @@ namespace LibGit2Sharp.Core
public static extern void git_index_free(IntPtr index);
[DllImport(libgit2)]
- public static extern IntPtr git_index_get(IndexSafeHandle index, int n);
+ public static extern IntPtr git_index_get(IndexSafeHandle index, uint n);
[DllImport(libgit2)]
public static extern int git_index_remove(IndexSafeHandle index, int n);
@@ -224,7 +224,7 @@ namespace LibGit2Sharp.Core
public static extern int git_tree_entry_attributes(IntPtr entry);
[DllImport(libgit2)]
- public static extern IntPtr git_tree_entry_byindex(IntPtr tree, int idx);
+ public static extern IntPtr git_tree_entry_byindex(IntPtr tree, uint idx);
[DllImport(libgit2)]
public static extern IntPtr git_tree_entry_byname(IntPtr tree, string filename);
@@ -236,6 +236,6 @@ namespace LibGit2Sharp.Core
public static extern IntPtr git_tree_entry_name(IntPtr entry);
[DllImport(libgit2)]
- public static extern int git_tree_entrycount(IntPtr tree);
+ public static extern uint git_tree_entrycount(IntPtr tree);
}
} \ No newline at end of file
diff --git a/LibGit2Sharp/Index.cs b/LibGit2Sharp/Index.cs
index 8f9aba70..8c4a3da9 100644
--- a/LibGit2Sharp/Index.cs
+++ b/LibGit2Sharp/Index.cs
@@ -38,11 +38,11 @@ namespace LibGit2Sharp
int res = NativeMethods.git_index_find(handle, path);
Ensure.Success(res, true);
- return this[res];
+ return this[(uint)res];
}
}
- private IndexEntry this[int index]
+ private IndexEntry this[uint index]
{
get
{
@@ -98,7 +98,7 @@ namespace LibGit2Sharp
/// <returns>An <see cref="IEnumerator{T}"/> object that can be used to iterate through the collection.</returns>
public IEnumerator<IndexEntry> GetEnumerator()
{
- for (int i = 0; i < Count; i++)
+ for (uint i = 0; i < Count; i++)
{
yield return this[i];
}
diff --git a/LibGit2Sharp/Tree.cs b/LibGit2Sharp/Tree.cs
index 4ed254bf..0981db1a 100644
--- a/LibGit2Sharp/Tree.cs
+++ b/LibGit2Sharp/Tree.cs
@@ -55,7 +55,7 @@ namespace LibGit2Sharp
{
using (var obj = new ObjectSafeWrapper(Id, repo))
{
- for (int i = 0; i < Count; i++)
+ for (uint i = 0; i < Count; i++)
{
IntPtr e = NativeMethods.git_tree_entry_byindex(obj.ObjectPtr, i);
yield return new TreeEntry(e, Id, repo);
@@ -76,7 +76,7 @@ namespace LibGit2Sharp
internal static Tree BuildFromPtr(IntPtr obj, ObjectId id, Repository repo)
{
- var tree = new Tree(id) { repo = repo, Count = NativeMethods.git_tree_entrycount(obj) };
+ var tree = new Tree(id) { repo = repo, Count = (int)NativeMethods.git_tree_entrycount(obj) };
return tree;
}
}