Skip to content

Commit f68acdc

Browse files
committed
Upgrade libgit2 binaries to 9adfa7d
1 parent 035cc85 commit f68acdc

File tree

8 files changed

+36
-9
lines changed

8 files changed

+36
-9
lines changed

Lib/NativeBinaries/amd64/git2.dll

6.5 KB
Binary file not shown.

Lib/NativeBinaries/amd64/git2.pdb

16 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.dll

5.5 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.pdb

0 Bytes
Binary file not shown.

LibGit2Sharp/Index.cs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,41 @@ private IndexEntry this[uint index]
8787

8888
#region IEnumerable<IndexEntry> Members
8989

90+
private class OrdinalComparer<T> : IComparer<T>
91+
{
92+
Func<T, string> accessor;
93+
94+
public OrdinalComparer(Func<T, string> accessor)
95+
{
96+
this.accessor = accessor;
97+
}
98+
99+
public int Compare(T x, T y)
100+
{
101+
return string.CompareOrdinal(accessor(x), accessor(y));
102+
}
103+
}
104+
105+
private List<IndexEntry> AllIndexEntries()
106+
{
107+
var list = new List<IndexEntry>();
108+
109+
for (uint i = 0; i < Count; i++)
110+
{
111+
list.Add(this[i]);
112+
}
113+
114+
list.Sort(new OrdinalComparer<IndexEntry>(i => i.Path));
115+
return list;
116+
}
117+
90118
/// <summary>
91119
/// Returns an enumerator that iterates through the collection.
92120
/// </summary>
93121
/// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
94122
public virtual IEnumerator<IndexEntry> GetEnumerator()
95123
{
96-
for (uint i = 0; i < Count; i++)
97-
{
98-
yield return this[i];
99-
}
124+
return AllIndexEntries().GetEnumerator();
100125
}
101126

102127
/// <summary>

LibGit2Sharp/ReferenceCollectionExtensions.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@ public static Reference UpdateTarget(this ReferenceCollection refsColl, string n
138138
var symbolicReference = reference as SymbolicReference;
139139
if (symbolicReference != null)
140140
{
141-
Reference targetRef = refsColl[canonicalRefNameOrObjectish];
141+
Reference targetRef;
142142

143-
if (targetRef == null)
143+
RefState refState = TryResolveReference(out targetRef, refsColl, canonicalRefNameOrObjectish);
144+
145+
if (refState == RefState.DoesNotLookValid)
144146
{
145-
throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "The reference specified by {0} is a Symbolic reference, you must provide a reference canonical name as the target.", name), "target");
147+
throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "The reference specified by {0} is a Symbolic reference, you must provide a reference canonical name as the target.", name), "canonicalRefNameOrObjectish");
146148
}
147149

148150
return refsColl.UpdateTarget(symbolicReference, targetRef);

LibGit2Sharp/libgit2_hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
411cb017c21e0490ed1c6438c7d5fa1b4ee9f63f
1+
9adfa7d147b319593789cbaeea94a97141b1e4f8

libgit2

Submodule libgit2 updated 91 files

0 commit comments

Comments
 (0)