@@ -7,37 +7,39 @@ internal static unsafe class Libgit2UnsafeHelper
7
7
public static IList < string > ListAllReferenceNames ( RepositorySafeHandle repo , GitReferenceType types )
8
8
{
9
9
UnSafeNativeMethods . git_strarray strArray
10000
;
10
- var res = UnSafeNativeMethods . git_reference_listall ( & strArray , repo , types ) ;
10
+ var res = UnSafeNativeMethods . git_reference_listall ( out strArray , repo , types ) ;
11
11
Ensure . Success ( res ) ;
12
12
13
- return BuildListOf ( & strArray ) ;
13
+ return BuildListOf ( strArray ) ;
14
14
}
15
15
16
16
public static IList < string > ListAllTagNames ( RepositorySafeHandle repo )
17
17
{
18
18
UnSafeNativeMethods . git_strarray strArray ;
19
- var res = UnSafeNativeMethods . git_tag_list ( & strArray , repo ) ;
19
+ var res = UnSafeNativeMethods . git_tag_list ( out strArray , repo ) ;
20
20
Ensure . Success ( res ) ;
21
21
22
- return BuildListOf ( & strArray ) ;
22
+ return BuildListOf ( strArray ) ;
23
23
}
24
24
25
- private static IList < string > BuildListOf ( UnSafeNativeMethods . git_strarray * strArray )
25
+ private static IList < string > BuildListOf ( UnSafeNativeMethods . git_strarray strArray )
26
26
{
27
27
var list = new List < string > ( ) ;
28
28
29
29
try
30
30
{
31
- int numberOfEntries = strArray ->size . ToInt32 ( ) ;
31
+ UnSafeNativeMethods . git_strarray * gitStrArray = & strArray ;
32
+
33
+ int numberOfEntries = gitStrArray ->size . ToInt32 ( ) ;
32
34
for ( uint i = 0 ; i < numberOfEntries ; i ++ )
33
35
{
34
- var name = new string ( strArray ->strings [ i ] ) ;
36
+ var name = new string ( gitStrArray ->strings [ i ] ) ;
35
37
list . Add ( name ) ;
36
38
}
37
39
}
38
40
finally
39
41
{
40
- UnSafeNativeMethods . git_strarray_free ( strArray ) ;
42
+ UnSafeNativeMethods . git_strarray_free ( ref strArray ) ;
41
43
}
42
44
43
45
return list ;
0 commit comments