8000 Merge pull request #1092 from libgit2/ntk/warnings · Svengali/libgit2sharp@b9ba915 · GitHub
[go: up one dir, main page]

Skip to content

Commit b9ba915

Browse files
committed
Merge pull request libgit2#1092 from libgit2/ntk/warnings
Minor OCD cleanups
2 parents 687b4e0 + ba91a27 commit b9ba915

25 files changed

+37
-70
lines changed

LibGit2Sharp.Tests/FilterFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ public void CanFilterLargeFiles()
238238

239239
private unsafe bool CharArrayAreEqual(char[] array1, char[] array2, int count)
240240
{
241-
if (Object.ReferenceEquals(array1, array2))
241+
if (ReferenceEquals(array1, array2))
242242
{
243243
return true;
244244
}
245-
if (Object.ReferenceEquals(array1, null) || Object.ReferenceEquals(null, array2))
245+
if (ReferenceEquals(array1, null) || ReferenceEquals(null, array2))
246246
{
247247
return false;
248248
}

LibGit2Sharp.Tests/SetErrorFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void FormatExceptionWithInnerException()
4242

4343
AssertExpectedExceptionMessage(expectedMessage, exceptionToThrow);
4444
}
45-
45+
4646
[Fact]
4747
public void FormatAggregateException()
4848
{

LibGit2Sharp.Tests/TestHelpers/Constants.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics;
33
using System.IO;
44
using System.Reflection;
5+
using System.Security;
56
using LibGit2Sharp.Core;
67

78
namespace LibGit2Sharp.Tests.TestHelpers
@@ -90,11 +91,11 @@ private static string UnwrapUnixTempPath()
9091
}
9192

9293
// To help with creating secure strings to test with.
93-
private static System.Security.SecureString StringToSecureString(string str)
94+
private static SecureString StringToSecureString(string str)
9495
{
9596
var chars = str.ToCharArray();
9697

97-
var secure = new System.Security.SecureString();
98+
var secure = new SecureString();
9899
for (var i = 0; i < chars.Length; i++)
99100
{
100101
secure.AppendChar(chars[i]);

LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
53

64
namespace LibGit2Sharp.Tests.TestHelpers
75
{

LibGit2Sharp/CherryPickOptions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using LibGit2Sharp.Core;
2-
using LibGit2Sharp.Handlers;
3-
4-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
52
{
63
/// <summary>
74
/// Options controlling CherryPick behavior.

LibGit2Sharp/Core/GitFilter.cs

Lines changed: 15 additions & 14 deletions
< 10000 tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.InteropServices;
3+
34
namespace LibGit2Sharp.Core
45
{
56
/// <summary>
@@ -34,10 +35,10 @@ internal class GitFilter
3435

3536
/// <summary>
3637
/// Initialize callback on filter
37-
///
38+
///
3839
/// Specified as `filter.initialize`, this is an optional callback invoked
3940
/// before a filter is first used. It will be called once at most.
40-
///
41+
///
4142
/// If non-NULL, the filter's `initialize` callback will be invoked right
4243
/// before the first use of the filter, so you can defer expensive
4344
/// initialization operations (in case libgit2 is being used in a way that doesn't need the filter).
@@ -46,7 +47,7 @@ internal class GitFilter
4647

4748
/// <summary>
4849
/// Shutdown callback on filter
49-
///
50+
///
5051
/// Specified as `filter.shutdown`, this is an optional callback invoked
5152
/// when the filter is unregistered or when libgit2 is shutting down. It
5253
/// will be called once at most and should release resources as needed.
@@ -57,28 +58,28 @@ internal class GitFilter
5758
/// <summary>
5859
/// Callback to decide if a given source needs this filter
5960
/// Specified as `filter.check`, this is an optional callback that checks if filtering is needed for a given source.
60-
///
61-
/// It should return 0 if the filter should be applied (i.e. success), GIT_PASSTHROUGH if the filter should
61+
///
62+
/// It should return 0 if the filter should be applied (i.e. success), GIT_PASSTHROUGH if the filter should
6263
/// not be applied, or an error code to fail out of the filter processing pipeline and return to the caller.
63-
///
64+
///
6465
/// The `attr_values` will be set to the values of any attributes given in the filter definition. See `git_filter` below for more detail.
65-
///
66-
/// The `payload` will be a pointer to a reference payload for the filter. This will start as NULL, but `check` can assign to this
66+
///
67+
/// The `payload` will be a pointer to a reference payload for the filter. This will start as NULL, but `check` can assign to this
6768
/// pointer for later use by the `apply` callback. Note that the value should be heap allocated (not stack), so that it doesn't go
68-
/// away before the `apply` callback can use it. If a filter allocates and assigns a value to the `payload`, it will need a `cleanup`
69+
/// away before the `apply` callback can use it. If a filter allocates and assigns a value to the `payload`, it will need a `cleanup`
6970
/// callback to free the payload.
7071
/// </summary>
7172
public delegate int git_filter_check_fn(
7273
GitFilter gitFilter, IntPtr payload, IntPtr filterSource, IntPtr attributeValues);
7374

7475
/// <summary>
7576
/// Callback to actually perform the data filtering
76-
///
77-
/// Specified as `filter.apply`, this is the callback that actually filters data.
77+
///
78+
/// Specified as `filter.apply`, this is the callback that actually filters data.
7879
/// If it successfully writes the output, it should return 0. Like `check`,
79-
/// it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run.
80+
/// it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run.
8081
/// Other error codes will stop filter processing and return to the caller.
81-
///
82+
///
8283
/// The `payload` value will refer to any payload that was set by the `check` callback. It may be read from or written to as needed.
8384
/// </summary>
8485
public delegate int git_filter_apply_fn(
@@ -89,7 +90,7 @@ public delegate int git_filter_stream_fn(
8990

9091
/// <summary>
9192
/// Callback to clean up after filtering has been applied. Specified as `filter.cleanup`, this is an optional callback invoked
92-
/// after the filter has been applied. If the `check` or `apply` callbacks allocated a `payload`
93+
/// after the filter has been applied. If the `check` or `apply` callbacks allocated a `payload`
9394
/// to keep per-source filter state, use this callback to free that payload and release resources as required.
9495
/// </summary>
9596
public delegate void git_filter_cleanup_fn(IntPtr gitFilter, IntPtr payload);

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Globalization;
33
using System.IO;
4-
using System.Reflection;
54
using System.Runtime.CompilerServices;
65
using System.Runtime.ConstrainedExecution;
76
using System.Runtime.InteropServices;

LibGit2Sharp/GlobalSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ internal static string GetAndLockNativeLibraryPath()
171171
}
172172

173173
/// <summary>
174-
/// Register a filter globally with a default priority of 200 allowing the custom filter
174+
/// Register a filter globally with a default priority of 200 allowing the custom filter
175175
/// to imitate a core Git filter driver. It will be run last on checkout and first on checkin.
176176
/// </summary>
177177
public static FilterRegistration RegisterFilter(Filter filter)

LibGit2Sharp/Handlers.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32

43
namespace LibGit2Sharp.Handlers
54
{

LibGit2Sharp/MergeAndCheckoutOptionsBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using LibGit2Sharp.Core;
22
using LibGit2Sharp.Handlers;
3-
using System;
43

54
namespace LibGit2Sharp
65
{

LibGit2Sharp/MergeConflictException.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
52

63
namespace LibGit2Sharp
74
{

LibGit2Sharp/MergeOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using LibGit2Sharp.Core;
3-
using LibGit2Sharp.Handlers;
42

53
namespace LibGit2Sharp
64
{

LibGit2Sharp/MergeTreeOptions.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using LibGit2Sharp.Core;
2-
using LibGit2Sharp.Handlers;
3-
using System;
4-
5-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
62
{
73
/// <summary>
84
/// Options controlling the behavior of two trees being merged.

LibGit2Sharp/MergeTreeResult.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using LibGit2Sharp.Core;
1+
using System.Collections.Generic;
42

53
namespace LibGit2Sharp
64
{

LibGit2Sharp/PushOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public sealed class PushOptions
4141
public PackBuilderProgressHandler OnPackBuilderProgress { get; set; }
4242

4343
/// <summary>
44-
/// Called once between the negotiation step and the upload. It provides
44+
/// Called once between the negotiation step and the upload. It provides
4545
/// information about what updates will be performed.
4646
/// </summary>
4747
public PrePushHandler OnNegotiationCompletedBeforePush { get; set; }

LibGit2Sharp/PushUpdate.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Runtime.InteropServices;
32
using LibGit2Sharp.Core;
43

54
namespace LibGit2Sharp

LibGit2Sharp/RecurseSubmodulesException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace LibGit2Sharp
54
{

LibGit2Sharp/RemoteUpdater.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4-
using System.Linq;
54
using LibGit2Sharp.Core;
65
using LibGit2Sharp.Core.Handles;
76

LibGit2Sharp/RepositoryOperationContext.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
6-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
72
{
83
/// <summary>
94
/// Class to convey information about the repository that is being operated on

LibGit2Sharp/RevertOptions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using LibGit2Sharp.Core;
2-
using LibGit2Sharp.Handlers;
3-
4-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
52
{
63
/// <summary>
74
/// Options controlling Revert behavior.

LibGit2Sharp/SecureUsernamePasswordCredentials.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using LibGit2Sharp.Core;
3-
using System.Security;
42
using System.Runtime.InteropServices;
3+
using System.Security;
4+
using LibGit2Sharp.Core;
55

66
namespace LibGit2Sharp
77
{

LibGit2Sharp/StashApplyOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using LibGit2Sharp.Core;
32
using LibGit2Sharp.Handlers;
43

54
namespace LibGit2Sharp
@@ -10,7 +9,7 @@ namespace LibGit2Sharp
109
public sealed class StashApplyOptions
1110
{
1211
/// <summary>
13-
/// <see cref="StashApplyModifiers"/> for controlling checkout index reinstating./>
12+
/// <see cref="StashApplyModifiers"/> for controlling checkout index reinstating./>
1413
/// </summary>
1514
/// <value>The flags.</value>
1615
public StashApplyModifiers ApplyModifiers { get; set; }

LibGit2Sharp/StashApplyProgress.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
42
{
53
/// <summary>
64
/// The current progress of the stash application.

LibGit2Sharp/StashApplyStatus.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace LibGit2Sharp
1+
namespace LibGit2Sharp
42
{
53
/// <summary>
64
/// The result of a stash application operation.

LibGit2Sharp/TreeEntryChanges.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ internal TreeEntryChanges(GitDiffDelta delta)
5555
/// be false during a conflict that deletes both the
5656
/// "ours" and "theirs" sides, or when the diff is a
5757
/// delete and the status is
58-
/// <see cref="ChangeType.Deleted"/>.
58+
/// <see cref="ChangeKind.Deleted"/>.
5959
/// </summary>
6060
public virtual bool Exists { get; private set; }
6161

@@ -79,13 +79,13 @@ internal TreeEntryChanges(GitDiffDelta delta)
7979
/// </summary>
8080
public virtual ObjectId OldOid { get; private set; }
8181

82-
/// <summary>
82+
/// <summary>
8383
/// The file exists in the old side of the diff.
8484
/// This is useful in determining if you have an ancestor
8585
/// side to a conflict. This will be false during a
8686
/// conflict that involves both the "ours" and "theirs"
8787
/// side being added, or when the diff is an add and the
88-
/// status is <see cref="ChangeType.Added"/>.
88+
/// status is <see cref="ChangeKind.Added"/>.
8989
/// </summary>
9090
public virtual bool OldExists { get; private set; }
9191

0 commit comments

Comments
 (0)
0