diff options
author | nulltoken <emeric.fermas@gmail.com> | 2015-06-16 08:53:44 +0300 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-06-16 08:53:44 +0300 |
commit | b9ba915b2cba9fe9a189e61c5042f890fceb1589 (patch) | |
tree | 46c2f4b749a1783a4f89942f92229e6feddf1d0a | |
parent | 687b4e0089b87ce1b5a62f5b2f279a148bc7e521 (diff) | |
parent | ba91a272fecd71ddd42b27788f1879403edf772c (diff) |
Merge pull request #1092 from libgit2/ntk/warnings
Minor OCD cleanups
25 files changed, 37 insertions, 70 deletions
diff --git a/LibGit2Sharp.Tests/FilterFixture.cs b/LibGit2Sharp.Tests/FilterFixture.cs index b0480256..10461d8c 100644 --- a/LibGit2Sharp.Tests/FilterFixture.cs +++ b/LibGit2Sharp.Tests/FilterFixture.cs @@ -238,11 +238,11 @@ namespace LibGit2Sharp.Tests 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; } diff --git a/LibGit2Sharp.Tests/SetErrorFixture.cs b/LibGit2Sharp.Tests/SetErrorFixture.cs index 62bdeab8..b10a5410 100644 --- a/LibGit2Sharp.Tests/SetErrorFixture.cs +++ b/LibGit2Sharp.Tests/SetErrorFixture.cs @@ -42,7 +42,7 @@ namespace LibGit2Sharp.Tests AssertExpectedExceptionMessage(expectedMessage, exceptionToThrow); } - + [Fact] public void FormatAggregateException() { diff --git a/LibGit2Sharp.Tests/TestHelpers/Constants.cs b/LibGit2Sharp.Tests/TestHelpers/Constants.cs index 85f95c0f..d3734207 100644 --- a/LibGit2Sharp.Tests/TestHelpers/Constants.cs +++ b/LibGit2Sharp.Tests/TestHelpers/Constants.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; +using System.Security; using LibGit2Sharp.Core; namespace LibGit2Sharp.Tests.TestHelpers @@ -90,11 +91,11 @@ namespace LibGit2Sharp.Tests.TestHelpers } // 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]); diff --git a/LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs b/LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs index aafdd5f3..a3e1e58c 100644 --- a/LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs +++ b/LibGit2Sharp.Tests/TestHelpers/TestRemoteRefs.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; namespace LibGit2Sharp.Tests.TestHelpers { diff --git a/LibGit2Sharp/CherryPickOptions.cs b/LibGit2Sharp/CherryPickOptions.cs index 8257fdb5..14aa0418 100644 --- a/LibGit2Sharp/CherryPickOptions.cs +++ b/LibGit2Sharp/CherryPickOptions.cs @@ -1,7 +1,4 @@ -using LibGit2Sharp.Core; -using LibGit2Sharp.Handlers; - -namespace LibGit2Sharp +namespace LibGit2Sharp { /// <summary> /// Options controlling CherryPick behavior. diff --git a/LibGit2Sharp/Core/GitFilter.cs b/LibGit2Sharp/Core/GitFilter.cs index eeb234be..1b177a8e 100644 --- a/LibGit2Sharp/Core/GitFilter.cs +++ b/LibGit2Sharp/Core/GitFilter.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; + namespace LibGit2Sharp.Core { /// <summary> @@ -34,10 +35,10 @@ namespace LibGit2Sharp.Core /// <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). @@ -46,7 +47,7 @@ namespace LibGit2Sharp.Core /// <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. @@ -57,15 +58,15 @@ namespace LibGit2Sharp.Core /// <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( @@ -73,12 +74,12 @@ namespace LibGit2Sharp.Core /// <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( @@ -89,7 +90,7 @@ namespace LibGit2Sharp.Core /// <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); diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index b01976dd..125822a4 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -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; diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs index d3eca3ae..d312b3a4 100644 --- a/LibGit2Sharp/GlobalSettings.cs +++ b/LibGit2Sharp/GlobalSettings.cs @@ -171,7 +171,7 @@ namespace LibGit2Sharp } /// <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) diff --git a/LibGit2Sharp/Handlers.cs b/LibGit2Sharp/Handlers.cs index 55a4d96e..a64b21cb 100644 --- a/LibGit2Sharp/Handlers.cs +++ b/LibGit2Sharp/Handlers.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace LibGit2Sharp.Handlers { diff --git a/LibGit2Sharp/MergeAndCheckoutOptionsBase.cs b/LibGit2Sharp/MergeAndCheckoutOptionsBase.cs index e9240e55..b0d7cfc1 100644 --- a/LibGit2Sharp/MergeAndCheckoutOptionsBase.cs +++ b/LibGit2Sharp/MergeAndCheckoutOptionsBase.cs @@ -1,6 +1,5 @@ using LibGit2Sharp.Core; using LibGit2Sharp.Handlers; -using System; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/MergeConflictException.cs b/LibGit2Sharp/MergeConflictException.cs index edcd5ebb..0d868919 100644 --- a/LibGit2Sharp/MergeConflictException.cs +++ b/LibGit2Sharp/MergeConflictException.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/MergeOptions.cs b/LibGit2Sharp/MergeOptions.cs index ccdbff3e..535d9a91 100644 --- a/LibGit2Sharp/MergeOptions.cs +++ b/LibGit2Sharp/MergeOptions.cs @@ -1,6 +1,4 @@ using System; -using LibGit2Sharp.Core; -using LibGit2Sharp.Handlers; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/MergeTreeOptions.cs b/LibGit2Sharp/MergeTreeOptions.cs index cf580d6f..910ec95f 100644 --- a/LibGit2Sharp/MergeTreeOptions.cs +++ b/LibGit2Sharp/MergeTreeOptions.cs @@ -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. diff --git a/LibGit2Sharp/MergeTreeResult.cs b/LibGit2Sharp/MergeTreeResult.cs index 50c305f3..2f54d956 100644 --- a/LibGit2Sharp/MergeTreeResult.cs +++ b/LibGit2Sharp/MergeTreeResult.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using LibGit2Sharp.Core; +using System.Collections.Generic; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/PushOptions.cs b/LibGit2Sharp/PushOptions.cs index f4874643..10eac139 100644 --- a/LibGit2Sharp/PushOptions.cs +++ b/LibGit2Sharp/PushOptions.cs @@ -41,7 +41,7 @@ namespace LibGit2Sharp 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; } diff --git a/LibGit2Sharp/PushUpdate.cs b/LibGit2Sharp/PushUpdate.cs index d948408c..8e7ac5cc 100644 --- a/LibGit2Sharp/PushUpdate.cs +++ b/LibGit2Sharp/PushUpdate.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.InteropServices; using LibGit2Sharp.Core; namespace LibGit2Sharp diff --git a/LibGit2Sharp/RecurseSubmodulesException.cs b/LibGit2Sharp/RecurseSubmodulesException.cs index e643df64..586261dd 100644 --- a/LibGit2Sharp/RecurseSubmodulesException.cs +++ b/LibGit2Sharp/RecurseSubmodulesException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/RemoteUpdater.cs b/LibGit2Sharp/RemoteUpdater.cs index 07c823bc..07ef39db 100644 --- a/LibGit2Sharp/RemoteUpdater.cs +++ b/LibGit2Sharp/RemoteUpdater.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using LibGit2Sharp.Core; using LibGit2Sharp.Core.Handles; diff --git a/LibGit2Sharp/RepositoryOperationContext.cs b/LibGit2Sharp/RepositoryOperationContext.cs index 466deb4c..4eb04330 100644 --- a/LibGit2Sharp/RepositoryOperationContext.cs +++ b/LibGit2Sharp/RepositoryOperationContext.cs @@ -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 diff --git a/LibGit2Sharp/RevertOptions.cs b/LibGit2Sharp/RevertOptions.cs index 04e43e44..c57794f0 100644 --- a/LibGit2Sharp/RevertOptions.cs +++ b/LibGit2Sharp/RevertOptions.cs @@ -1,7 +1,4 @@ -using LibGit2Sharp.Core; -using LibGit2Sharp.Handlers; - -namespace LibGit2Sharp +namespace LibGit2Sharp { /// <summary> /// Options controlling Revert behavior. diff --git a/LibGit2Sharp/SecureUsernamePasswordCredentials.cs b/LibGit2Sharp/SecureUsernamePasswordCredentials.cs index 5e1d4931..16427ddf 100644 --- a/LibGit2Sharp/SecureUsernamePasswordCredentials.cs +++ b/LibGit2Sharp/SecureUsernamePasswordCredentials.cs @@ -1,7 +1,7 @@ using System; -using LibGit2Sharp.Core; -using System.Security; using System.Runtime.InteropServices; +using System.Security; +using LibGit2Sharp.Core; namespace LibGit2Sharp { diff --git a/LibGit2Sharp/StashApplyOptions.cs b/LibGit2Sharp/StashApplyOptions.cs index 0af54829..624546f9 100644 --- a/LibGit2Sharp/StashApplyOptions.cs +++ b/LibGit2Sharp/StashApplyOptions.cs @@ -1,5 +1,4 @@ using System; -using LibGit2Sharp.Core; using LibGit2Sharp.Handlers; namespace LibGit2Sharp @@ -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; } diff --git a/LibGit2Sharp/StashApplyProgress.cs b/LibGit2Sharp/StashApplyProgress.cs index c9683976..329e8874 100644 --- a/LibGit2Sharp/StashApplyProgress.cs +++ b/LibGit2Sharp/StashApplyProgress.cs @@ -1,6 +1,4 @@ -using System; - -namespace LibGit2Sharp +namespace LibGit2Sharp { /// <summary> /// The current progress of the stash application. diff --git a/LibGit2Sharp/StashApplyStatus.cs b/LibGit2Sharp/StashApplyStatus.cs index 25ab991a..4a0ce882 100644 --- a/LibGit2Sharp/StashApplyStatus.cs +++ b/LibGit2Sharp/StashApplyStatus.cs @@ -1,6 +1,4 @@ -using System; - -namespace LibGit2Sharp +namespace LibGit2Sharp { /// <summary> /// The result of a stash application operation. diff --git a/LibGit2Sharp/TreeEntryChanges.cs b/LibGit2Sharp/TreeEntryChanges.cs index bb288d26..e731de79 100644 --- a/LibGit2Sharp/TreeEntryChanges.cs +++ b/LibGit2Sharp/TreeEntryChanges.cs @@ -55,7 +55,7 @@ namespace LibGit2Sharp /// 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; } @@ -79,13 +79,13 @@ namespace LibGit2Sharp /// </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; } |