Skip to content

Fix compilation warning #1221

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 1 commit into from
Nov 6, 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
9 changes: 4 additions & 5 deletions LibGit2Sharp.Tests/MergeFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public void MergeReportsCheckoutProgress()
OnCheckoutProgress = (path, completed, total) => wasCalled = true,
};

MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
repo.Merge(commitToMerge, Constants.Signature, options);

Assert.True(wasCalled);
}
Expand All @@ -384,7 +384,7 @@ public void MergeReportsCheckoutNotifications()
CheckoutNotifyFlags = CheckoutNotifyFlags.Updated,
};

MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
repo.Merge(commitToMerge, Constants.Signature, options);

Assert.True(wasCalled);
Assert.Equal(CheckoutNotifyFlags.Updated, actualNotifyFlags);
Expand All @@ -406,7 +406,7 @@ public void FastForwardMergeReportsCheckoutProgress()
OnCheckoutProgress = (path, completed, total) => wasCalled = true,
};

MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
repo.Merge(commitToMerge, Constants.Signature, options);

Assert.True(wasCalled);
}
Expand All @@ -429,7 +429,7 @@ public void FastForwardMergeReportsCheckoutNotifications()
CheckoutNotifyFlags = CheckoutNotifyFlags.Updated,
};

MergeResult result = repo.Merge(commitToMerge, Constants.Signature, options);
repo.Merge(commitToMerge, Constants.Signature, options);

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

var status = repo.RetrieveStatus();
MergeOptions mergeOptions = new MergeOptions()
{
MergeFileFavor = fileFavorFlag,
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp.Tests/NetworkFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void CanPullIntoEmptyRepo()
using (var repo = new Repository(repoPath))
{
// Set up remote
Remote remote = repo.Network.Remotes.Add(remoteName, url);
repo.Network.Remotes.Add(remoteName, url);

// Set up tracking information
repo.Branches.Update(repo.Head,
Expand Down
14 changes: 2 additions & 12 deletions LibGit2Sharp.Tests/PackBuilderFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,13 @@ internal void AddingObjectsTestDelegate(IRepository repo, PackBuilder builder)
[Fact]
public void ExceptionIfPathDoesNotExist()
{
PackBuilderOptions pbo;

Assert.Throws<DirectoryNotFoundException>(() =>
{
pbo = new PackBuilderOptions("aaa");
});
Assert.Throws<DirectoryNotFoundException>(() => new PackBuilderOptions("aaa"));
}

[Fact]
public void ExceptionIfPathEqualsNull()
{
PackBuilderOptions pbo;

Assert.Throws<ArgumentNullException>(() =>
{
pbo = new PackBuilderOptions(null);
});
Assert.Throws<ArgumentNullException>(() => new PackBuilderOptions(null));
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions LibGit2Sharp.Tests/RevertFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public void CanRevertAndNotCommit()
string path = SandboxRevertTestRepo();
using (var repo = new Repository(path))
{
string modifiedFileFullPath = Path.Combine(repo.Info.WorkingDirectory, revertedFile);

// Checkout the revert branch.
Branch branch = repo.Checkout(revertBranchName);
Assert.NotNull(branch);
Expand Down Expand Up @@ -160,6 +158,7 @@ public void RevertWithFileConflictStrategyOption(CheckoutFileConflictStrategy co
};

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

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

Assert.True(wasCalled);
Assert.Equal(CheckoutNotifyFlags.Updated, actualNotifyFlags);
}
}

Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp.Tests/SmartSubtransportFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void CustomSmartSubtransportTest(string scheme, string url)
registration = GlobalSettings.RegisterSmartSubtransport<MockSmartSubtransport>(scheme);
Assert.NotNull(registration);

using (var repo = new Repository(scd.DirectoryPath))
using (var repo = new Repository(repoPath))
{
Remote remote = repo.Network.Remotes.Add(remoteName, url);

Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp.Tests/StatusFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void RetrievingTheStatusOfADirectoryThrows()
var path = SandboxStandardTestRepoGitDir();
using (var repo = new Repository(path))
{
Assert.Throws<AmbiguousSpecificationException>(() => { FileStatus status = repo.RetrieveStatus("1"); });
Assert.Throws<AmbiguousSpecificationException>(() => { repo.RetrieveStatus("1"); });
}
}

Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp.Tests/TestHelpers/FileExportFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ protected override void Smudge(string path, string root, Stream input, Stream ou
{
SmudgeCalledCount++;

string filename = Path.GetFileName(path);
StringBuilder text = new StringBuilder();

byte[] buffer = new byte[64 * 1024];
Expand Down
1 change: 0 additions & 1 deletion LibGit2Sharp/Filter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ protected Filter(string name, IEnumerable<FilterAttributeEntry> attributes)
private readonly string name;
private readonly IEnumerable<FilterAttributeEntry> attributes;
private readonly GitFilter gitFilter;
private readonly object @lock = new object();

private GitWriteStream thisStream;
private GitWriteStream nextStream;
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public interface IRepository : IDisposable
/// </summary>
/// <param name="resetMode">Flavor of reset operation to perform.</param>
/// <param name="commit">The target commit object.</param>
/// <param name="opts">Collection of parameters controlling checkout behavior.</param>
/// <param name="options">Collection of parameters controlling checkout behavior.</param>
void Reset(ResetMode resetMode, Commit commit, CheckoutOptions options);

/// <summary>
Expand Down
10 changes: 3 additions & 7 deletions LibGit2Sharp/RebaseOperationImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,20 @@ public static RebaseResult Run(RebaseSafeHandle rebaseOperationHandle,
else
{
// No step to apply - need to complete the rebase.
rebaseResult = CompleteRebase(rebaseOperationHandle, committer, rebaseResult);
rebaseResult = CompleteRebase(rebaseOperationHandle, committer);
}
}

return rebaseResult;
}

private static RebaseResult CompleteRebase(RebaseSafeHandle rebaseOperationHandle, Identity committer, RebaseResult rebaseResult)
private static RebaseResult CompleteRebase(RebaseSafeHandle rebaseOperationHandle, Identity committer)
{
long totalStepCount = Proxy.git_rebase_operation_entrycount(rebaseOperationHandle);
GitRebaseOptions gitRebaseOptions = new GitRebaseOptions()
{
version = 1,
};

// Rebase is completed!
Proxy.git_rebase_finish(rebaseOperationHandle, committer);
rebaseResult = new RebaseResult(RebaseStatus.Complete,
var rebaseResult = new RebaseResult(RebaseStatus.Complete,
totalStepCount,
totalStepCount,
null);
Expand Down