10000 Fix compilation warnings · chescock/libgit2sharp@f37a4eb · GitHub
[go: up one dir, main page]

Skip to content

Commit f37a4eb

Browse files
committed
Fix compilation warnings
1 parent bdc8dbe commit f37a4eb

File tree

10 files changed

+15
-32
lines changed
  • LibGit2Sharp.Tests
  • LibGit2Sharp
  • 10 files changed

    +15
    -32
    lines changed

    LibGit2Sharp.Tests/MergeFixture.cs

    Lines changed: 4 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -361,7 +361,7 @@ public void MergeReportsCheckoutProgress()
    361361
    OnCheckoutProgress = (path, completed, total) => wasCalled = true,
    362362
    };
    363363

    364-
    MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
    364+
    repo.Merge(commitToMerge, Constants.Signature, options);
    365365

    366366
    Assert.True(wasCalled);
    367367
    }
    @@ -384,7 +384,7 @@ public void MergeReportsCheckoutNotifications()
    384384
    CheckoutNotifyFlags = CheckoutNotifyFlags.Updated,
    385385
    };
    386386

    387-
    MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
    387+
    repo.Merge(commitToMerge, Constants.Signature, options);
    388388

    389389
    Assert.True(wasCalled);
    390390
    Assert.Equal(CheckoutNotifyFlags.Updated, actualNotifyFlags);
    406406
    OnCheckoutProgress = (path, completed, total) => wasCalled = true,
    407407
    };
    408408

    409-
    MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
    409+
    repo.Merge(commitToMerge, Constants.Signature, options);
    410410

    411411
    Assert.True(wasCalled);
    412412
    }
    @@ -429,7 +429,7 @@ public void FastForwardMergeReportsCheckoutNotifications()
    429429
    CheckoutNotifyFlags = CheckoutNotifyFlags.Updated,
    430430
    };
    431431

    432-
    MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
    432+
    repo.Merge(commitToMerge, Constants.Signature, options);
    433433

    434434
    Assert.True(wasCalled);
    435435
    Assert.Equal(CheckoutNotifyFlags.Updated, actualNotifyFlags);
    @@ -665,7 +665,6 @@ public void MergeCanSpecifyMergeFileFavorOption(MergeFileFavor fileFavorFlag)
    665665
    Branch branch = repo.Branches[conflictBranchName];
    666666
    Assert.NotNull(branch);
    667667

    668-
    var status = repo.RetrieveStatus();
    669668
    MergeOptions mergeOptions = new MergeOptions()
    670669
    {
    671670
    MergeFileFavor = fileFavorFlag,

    LibGit2Sharp.Tests/NetworkFixture.cs

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -189,7 +189,7 @@ public void CanPullIntoEmptyRepo()
    189189
    using (var repo = new Repository(repoPath))
    190190
    {
    191191
    // Set up remote
    192-
    Remote remote = repo.Network.Remotes.Add(remoteName, url);
    192+
    repo.Network.Remotes.Add(remoteName, url);
    193193

    194194
    // Set up tracking information
    195195
    repo.Branches.Update(repo.Head,

    LibGit2Sharp.Tests/PackBuilderFixture.cs

    Lines changed: 2 additions & 12 deletions
    Original file line numberDiff line numberDiff line change
    @@ -103,23 +103,13 @@ internal void AddingObjectsTestDelegate(IRepository repo, PackBuilder builder)
    103103
    [Fact]
    104104
    public void ExceptionIfPathDoesNotExist()
    105105
    {
    106-
    PackBuilderOptions pbo;
    107-
    108-
    Assert.Throws<DirectoryNotFoundException>(() =>
    109-
    {
    110-
    pbo = new PackBuilderOptions("aaa");
    111-
    });
    106+
    Assert.Throws<DirectoryNotFoundException>(() => new PackBuilderOptions("aaa"));
    112107
    }
    113108

    114109
    [Fact]
    115110
    public void ExceptionIfPathEqualsNull()
    116111
    {
    117-
    PackBuilderOptions pbo;
    118-
    119-
    Assert.Throws<ArgumentNullException>(() =>
    120-
    {
    121-
    pbo = new PackBuilderOptions(null);
    122-
    });
    112+
    Assert.Throws<ArgumentNullException>(() => new PackBuilderOptions(null));
    123113
    }
    124114

    125115
    [Fact]

    LibGit2Sharp.Tests/RevertFixture.cs

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -67,8 +67,6 @@ public void CanRevertAndNotCommit()
    6767
    string path = SandboxRevertTestRepo();
    6868
    using (var repo = new Repository(path))
    6969
    {
    70-
    string modifiedFileFullPath = Path.Combine(repo.Info.WorkingDirectory, revertedFile);
    71-
    7270
    // Checkout the revert branch.
    7371
    Branch branch = repo.Checkout(revertBranchName);
    7472
    Assert.NotNull(branch);
    @@ -160,6 +158,7 @@ public void RevertWithFileConflictStrategyOption(CheckoutFileConflictStrategy co
    160158
    };
    161159

    162160
    RevertResult result = repo.Revert(repo.Head.Tip.Parents.First(), Constants.Signature, options);
    161+
    Assert.Equal(RevertStatus.Conflicts, result.Status);
    163162

    164163
    // Verify there is a conflict.
    165164
    Assert.False(repo.Index.IsFullyMerged);
    @@ -242,6 +241,7 @@ public void RevertReportsCheckoutNotification()
    242241
    repo.Revert(repo.Head.Tip, Constants.Signature, options);
    243242

    244243
    Assert.True(wasCalled);
    244+
    Assert.Equal(CheckoutNotifyFlags.Updated, actualNotifyFlags);
    245245
    }
    246246
    }
    247247

    LibGit2Sharp.Tests/SmartSubtransportFixture.cs

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -38,7 +38,7 @@ public void CustomSmartSubtransportTest(string scheme, string url)
    3838
    registration = GlobalSettings.RegisterSmartSubtransport<MockSmartSubtransport>(scheme);
    3939
    Assert.NotNull(registration);
    4040

    41-
    using (var repo = new Repository(scd.DirectoryPath))
    41+
    using (var repo = new Repository(repoPath))
    4242
    {
    4343
    Remote remote = repo.Network.Remotes.Add(remoteName, url);
    4444

    LibGit2Sharp.Tests/StatusFixture.cs

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -99,7 +99,7 @@ public void RetrievingTheStatusOfADirectoryThrows()
    9999
    var path = SandboxStandardTestRepoGitDir();
    100100
    using (var repo = new Repository(path))
    101101
    {
    102-
    Assert.Throws<AmbiguousSpecificationException>(() => { FileStatus status = repo.RetrieveStatus("1"); });
    102+
    Assert.Throws<AmbiguousSpecificationException>(() => { repo.RetrieveStatus("1"); });
    103103
    }
    104104
    }
    105105

    LibGit2Sharp.Tests/TestHelpers/FileExportFilter.cs

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -77,7 +77,6 @@ protected override void Smudge(string path, string root, Stream input, Stream ou
    7777
    {
    7878
    SmudgeCalledCount++;
    7979

    80-
    string filename = Path.GetFileName(path);
    8180
    StringBuilder text = new StringBuilder();
    8281

    8382
    byte[] buffer = new byte[64 * 1024];

    LibGit2Sharp/Filter.cs

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -52,7 +52,6 @@ protected Filter(string name, IEnumerable<FilterAttributeEntry> attributes)
    5252
    private readonly string name;
    5353
    private readonly IEnumerable<FilterAttributeEntry> attributes;
    5454
    private readonly GitFilter gitFilter;
    55-
    private readonly object @lock = new object();
    5655

    5756
    private GitWriteStream thisStream;
    5857
    private GitWriteStream nextStream;

    LibGit2Sharp/IRepository.cs

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -171,7 +171,7 @@ public interface IRepository : IDisposable
    171171
    /// </summary>
    172172
    /// <param name="resetMode">Flavor of reset operation to perform.</param>
    173173
    /// <param name="commit">The target commit object.</param>
    174-
    /// <param name="opts">Collection of parameters controlling checkout behavior.</param>
    174+
    /// <param name="options">Collection of parameters controlling checkout behavior.</param>
    175175
    void Reset(ResetMode resetMode, Commit commit, CheckoutOptions options);
    176176

    177177
    /// <summary>

    LibGit2Sharp/RebaseOperationImpl.cs

    Lines changed: 3 additions & 7 deletions
    Original file line numberDiff line numberDiff line change
    @@ -43,24 +43,20 @@ public static RebaseResult Run(RebaseSafeHandle rebaseOperationHandle,
    4343
    else
    4444
    {
    4545
    // No step to apply - need to complete the rebase.
    46-
    rebaseResult = CompleteRebase(rebaseOperationHandle, committer, rebaseResult);
    46+
    rebaseResult = CompleteRebase(rebaseOperationHandle, committer);
    4747
    }
    4848
    }
    4949

    5050
    return rebaseResult;
    5151
    }
    5252

    53-
    private static RebaseResult CompleteRebase(RebaseSafeHandle rebaseOperationHandle, Identity committer, RebaseResult rebaseResult)
    53+
    private static RebaseResult CompleteRebase(RebaseSafeHandle rebaseOperationHandle, Identity committer)
    5454
    {
    5555
    long totalStepCount = Proxy.git_rebase_operation_entrycount(rebaseOperationHandle);
    56-
    GitRebaseOptions gitRebaseOptions = new GitRebaseOptions()
    57-
    {
    58-
    version = 1,
    59-
    };
    6056

    6157
    // Rebase is completed!
    6258
    Proxy.git_rebase_finish< 559A /span>(rebaseOperationHandle, committer);
    63-
    rebaseResult = new RebaseResult(RebaseStatus.Complete,
    59+
    var rebaseResult = new RebaseResult(RebaseStatus.Complete,
    6460
    totalStepCount,
    6561
    totalStepCount,
    6662
    null);

    0 commit comments

    Comments
     (0)
    0