Skip to content

Minor OCD cleanups #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LibGit2Sharp.Tests/FilterFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ public void CanFilterLargeFiles()

private unsafe bool CharArrayAreEqual(char[] array1, char[] array2, int count)
{
if (Object.ReferenceEquals(array1, array2))
if (ReferenceEquals(array1, array2))
{
return true;
}
if (Object.ReferenceEquals(array1, null) || Object.ReferenceEquals(null, array2))
if (ReferenceEquals(array1, null) || ReferenceEquals(null, array2))
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp.Tests/SetErrorFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void FormatExceptionWithInnerException()

AssertExpectedExceptionMessage(expectedMessage, exceptionToThrow);
}

[Fact]
public void FormatAggregateException()
{
Expand Down
5 changes: 3 additions & 2 deletions LibGit2Sharp.Tests/TestHelpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security;
using LibGit2Sharp.Core;

namespace LibGit2Sharp.Tests.TestHelpers
Expand Down Expand Up @@ -90,11 +91,11 @@ private static string UnwrapUnixTempPath()
}

// To help with creating secure strings to test with.
private static System.Security.SecureString StringToSecureString(string str)
private static SecureString StringToSecureString(string str)
{
var chars = str.ToCharArray();

var secure = new System.Security.SecureString();
var secure = new SecureString();
for (var i = 0; i < chars.Length; i++)
{
secure.AppendChar(chars[i]);
Expand Down
2 changes: 0 additions & 2 deletions LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibGit2Sharp.Tests.TestHelpers
{
Expand Down
5 changes: 1 addition & 4 deletions LibGit2Sharp/CherryPickOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// Options controlling CherryPick behavior.
Expand Down
29 changes: 15 additions & 14 deletions LibGit2Sharp/Core/GitFilter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Runtime.InteropServices;

namespace LibGit2Sharp.Core
{
/// <summary>
Expand Down Expand Up @@ -34,10 +35,10 @@ internal class GitFilter

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

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

/// <summary>
/// Callback to actually perform the data filtering
///
/// Specified as `filter.apply`, this is the callback that actually filters data.
///
/// Specified as `filter.apply`, this is the callback that actually filters data.
/// If it successfully writes the output, it should return 0. Like `check`,
/// it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run.
/// it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run.
/// Other error codes will stop filter processing and return to the caller.
///
///
/// 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.
/// </summary>
public delegate int git_filter_apply_fn(
Expand All @@ -89,7 +90,7 @@ public delegate int git_filter_stream_fn(

/// <summary>
/// Callback to clean up after filtering has been applied. Specified as `filter.cleanup`, this is an optional callback invoked
/// after the filter has been applied. If the `check` or `apply` callbacks allocated a `payload`
/// after the filter has been applied. If the `check` or `apply` callbacks allocated a `payload`
/// to keep per-source filter state, use this callback to free that payload and release resources as required.
/// </summary>
public delegate void git_filter_cleanup_fn(IntPtr gitFilter, IntPtr payload);
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/Core/NativeMethods.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ internal static string GetAndLockNativeLibraryPath()
}

/// <summary>
/// Register a filter globally with a default priority of 200 allowing the custom filter
/// Register a filter globally with a default priority of 200 allowing the custom filter
/// to imitate a core Git filter driver. It will be run last on checkout and first on checkin.
/// </summary>
public static FilterRegistration RegisterFilter(Filter filter)
Expand Down
3 changes: 1 addition & 2 deletions LibGit2Sharp/Handlers.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;

namespace LibGit2Sharp.Handlers
{
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/MergeAndCheckoutOptionsBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;
using System;

namespace LibGit2Sharp
{
Expand Down
3 changes: 0 additions & 3 deletions LibGit2Sharp/MergeConflictException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibGit2Sharp
{
Expand Down
2 changes: 0 additions & 2 deletions LibGit2Sharp/MergeOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;

namespace LibGit2Sharp
{
Expand Down
6 changes: 1 addition & 5 deletions LibGit2Sharp/MergeTreeOptions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;
using System;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// Options controlling the behavior of two trees being merged.
Expand Down
4 changes: 1 addition & 3 deletions LibGit2Sharp/MergeTreeResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using LibGit2Sharp.Core;
using System.Collections.Generic;

namespace LibGit2Sharp
{
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/PushOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed class PushOptions
public PackBuilderProgressHandler OnPackBuilderProgress { get; set; }

/// <summary>
/// Called once between the negotiation step and the upload. It provides
/// Called once between the negotiation step and the upload. It provides
/// information about what updates will be performed.
/// </summary>
public PrePushHandler OnNegotiationCompletedBeforePush { get; set; }
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/PushUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.InteropServices;
using LibGit2Sharp.Core;

namespace LibGit2Sharp
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/RecurseSubmodulesException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace LibGit2Sharp
{
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/RemoteUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Handles;

Expand Down
7 changes: 1 addition & 6 deletions LibGit2Sharp/RepositoryOperationContext.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// Class to convey information about the repository that is being operated on
Expand Down
5 changes: 1 addition & 4 deletions LibGit2Sharp/RevertOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// Options controlling Revert behavior.
Expand Down
4 changes: 2 additions & 2 deletions LibGit2Sharp/SecureUsernamePasswordCredentials.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using LibGit2Sharp.Core;
using System.Security;
using System.Runtime.InteropServices;
using System.Security;
using LibGit2Sharp.Core;

namespace LibGit2Sharp
{
Expand Down
3 changes: 1 addition & 2 deletions LibGit2Sharp/StashApplyOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;

namespace LibGit2Sharp
Expand All @@ -10,7 +9,7 @@ namespace LibGit2Sharp
public sealed class StashApplyOptions
{
/// <summary>
/// <see cref="StashApplyModifiers"/> for controlling checkout index reinstating./>
/// <see cref="StashApplyModifiers"/> for controlling checkout index reinstating./>
/// </summary>
/// <value>The flags.</value>
public StashApplyModifiers ApplyModifiers { get; set; }
Expand Down
4 changes: 1 addition & 3 deletions LibGit2Sharp/StashApplyProgress.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// The current progress of the stash application.
Expand Down
4 changes: 1 addition & 3 deletions LibGit2Sharp/StashApplyStatus.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace LibGit2Sharp
namespace LibGit2Sharp
{
/// <summary>
/// The result of a stash application operation.
Expand Down
6 changes: 3 additions & 3 deletions LibGit2Sharp/TreeEntryChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal TreeEntryChanges(GitDiffDelta delta)
/// be false during a conflict that deletes both the
/// "ours" and "theirs" sides, or when the diff is a
/// delete and the status is
/// <see cref="ChangeType.Deleted"/>.
/// <see cref="ChangeKind.Deleted"/>.
/// </summary>
public virtual bool Exists { get; private set; }

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

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

Expand Down