Skip to content

Commit 58a537f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into portable
2 parents bbf0096 + 2a8b1f0 commit 58a537f

File tree

11 files changed

+46
-185
lines changed

11 files changed

+46
-185
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33

44
language: csharp
55
mono:
6-
- 3.12.0
7-
- 4.2.3
6+
- latest
87

98
os:
109
- osx
1110
- linux
1211

13-
# The newer image cannot find mono 3.12 in the PATH
14-
osx_image: xcode6.4
15-
1612
env:
1713
global:
1814
- MONO_OPTIONS=--debug
1915

16+
install:
17+
- curl -L -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
18+
- mono nuget.exe restore LibGit2Sharp.sln
19+
2020
before_install:
2121
- date -u
2222
- uname -a

LibGit2Sharp.Tests/ConfigurationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public static IEnumerable<object[]> ConfigAccessors
366366
}
367367
}
368368

369-
[Theory, PropertyData("ConfigAccessors")]
369+
[Theory, MemberData(nameof(ConfigAccessors))]
370370
public void CanAccessConfigurationWithoutARepository(Func<string, string> localConfigurationPathProvider)
371371
{
372372
var path = SandboxStandardTestRepoGitDir();

LibGit2Sharp.Tests/ConflictFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void CanGetOriginalNamesOfRenameConflicts()
112112
}
113113
}
114114

115-
[Theory, PropertyData("ConflictData")]
115+
[Theory, MemberData(nameof(ConflictData))]
116116
public void CanRetrieveSingleConflictByPath(string filepath, string ancestorId, string ourId, string theirId)
117117
{
118118
var path = SandboxMergedTestRepo();

LibGit2Sharp.Tests/IndexFixture.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,28 +158,34 @@ public void CanMoveAnExistingFileOverANonExistingFile(string sourcePath, FileSta
158158
}
159159

160160
[Theory]
161-
[InlineData("README", FileStatus.Unaltered, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
162-
[InlineData("new_tracked_file.txt", FileStatus.NewInIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
163-
[InlineData("modified_staged_file.txt", FileStatus.ModifiedInIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
164-
[InlineData("modified_unstaged_file.txt", FileStatus.ModifiedInWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
165-
public void MovingOverAnExistingFileThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
161+
[InlineData("README", FileStatus.Unaltered)]
162+
[InlineData("new_tracked_file.txt", FileStatus.NewInIndex)]
163+
[InlineData("modified_staged_file.txt", FileStatus.ModifiedInIndex)]
164+
[InlineData("modified_unstaged_file.txt", FileStatus.ModifiedInWorkdir)]
165+
public void MovingOverAnExistingFileThrows(string sourcePath, FileStatus sourceStatus)
166166
{
167+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" };
168+
167169
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
168170
}
169171

170172
[Theory]
171-
[InlineData("new_untracked_file.txt", FileStatus.NewInWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
172-
public void MovingAFileWichIsNotUnderSourceControlThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
173+
[InlineData("new_untracked_file.txt", FileStatus.NewInWorkdir)]
174+
public void MovingAFileWichIsNotUnderSourceControlThrows(string sourcePath, FileStatus sourceStatus)
173175
{
176+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" };
177+
174178
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
175179
}
176180

177181
[Theory]
178-
[InlineData("deleted_unstaged_file.txt", FileStatus.DeletedFromWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
179-
[InlineData("deleted_staged_file.txt", FileStatus.DeletedFromIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
180-
[InlineData("i_dont_exist.txt", FileStatus.Nonexistent, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
181-
public void MovingAFileNotInTheWorkingDirectoryThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
182+
[InlineData("deleted_unstaged_file.txt", FileStatus.DeletedFromWorkdir)]
183+
[InlineData("deleted_staged_file.txt", FileStatus.DeletedFromIndex)]
184+
[InlineData("i_dont_exist.txt", FileStatus.Nonexistent)]
185+
public void MovingAFileNotInTheWorkingDirectoryThrows(string sourcePath, FileStatus sourceStatus)
182186
{
187+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" };
188+
183189
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
184190
}
185191

LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
<ProjectReference Include="..\LibGit2Sharp\LibGit2Sharp.csproj" />
1818
</ItemGroup>
1919
<ItemGroup>
20-
<PackageReference Include="Moq" Version="4.2.1507.0118" />
21-
<PackageReference Include="xunit" Version="1.9.2" />
22-
<PackageReference Include="xunit.extensions" Version="1.9.2" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="2.1.0" />
24-
<PackageReference Include="xunit.runner.console" Version="2.0.0" />
25-
<PackageReference Include="xunit.runner.msbuild" Version="2.0.0" />
20+
<PackageReference Include="Moq" Version="4.7.8" />
21+
<PackageReference Include="xunit" Version="2.2.0" />
22+
<PackageReference Include="xunit.skippablefact" Version="1.3.1" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
24+
<PackageReference Include="xunit.runner.console" Version="2.2.0" />
25+
<PackageReference Include="xunit.runner.msbuild" Version="2.2.0" />
2626
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
2727
</ItemGroup>
2828
<Import Project="..\LibGit2Sharp\ExtraDefine.targets" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Xunit;
2+
3+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

LibGit2Sharp.Tests/StageFixture.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public void CanStageAnUnknownFileWithLaxUnmatchedExplicitPathsValidation(string
101101
Assert.Null(repo.Index[relativePath]);
102102
Assert.Equal(status, repo.RetrieveStatus(relativePath));
103103

104-
Assert.DoesNotThrow(() => Commands.Stage(repo, relativePath));
105-
Assert.DoesNotThrow(() => Commands.Stage(repo, relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false } }));
104+
Commands.Stage(repo, relativePath);
105+
Commands.Stage(repo, relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false } });
106106

107107
Assert.Equal(status, repo.RetrieveStatus(relativePath));
108108
}
@@ -405,8 +405,7 @@ public void CanSuccessfullyStageTheContentOfAModifiedFileOfTheSameSizeWithinTheS
405405

406406
Commands.Stage(repo, "test.txt");
407407

408-
Assert.DoesNotThrow(() => repo.Commit(
409-
"Commit", Constants.Signature, Constants.Signature));
408+
repo.Commit("Commit", Constants.Signature, Constants.Signature);
410409
}
411410
}
412411
}

LibGit2Sharp.Tests/TestHelpers/SkippableFactAttribute.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

LibGit2Sharp.Tests/UnstageFixture.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public void CanUnstageUnknownPathsWithLaxUnmatchedExplicitPathsValidation(string
125125
{
126126
Assert.Equal(currentStatus, repo.RetrieveStatus(relativePath));
127127

128-
Assert.DoesNotThrow(() => Commands.Unstage(repo, relativePath, new ExplicitPathsOptions() { ShouldFailOnUnmatchedPath = false }));
128+
Commands.Unstage(repo, relativePath, new ExplicitPathsOptions() { ShouldFailOnUnmatchedPath = false });
129+
129130
Assert.Equal(currentStatus, repo.RetrieveStatus(relativePath));
130131
}
131132
}
@@ -201,8 +202,9 @@ public void CanUnstageUnknownPathsAgainstAnOrphanedHeadWithLaxUnmatchedExplicitP
201202

202203
Assert.Equal(currentStatus, repo.RetrieveStatus(relativePath));
203204

204-
Assert.DoesNotThrow(() => Commands.Unstage(repo, relativePath));
205-
Assert.DoesNotThrow(() => Commands.Unstage(repo, relativePath, new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false }));
205+
Commands.Unstage(repo, relativePath);
206+
Commands.Unstage(repo, relativePath, new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false });
207+
206208
Assert.Equal(currentStatus, repo.RetrieveStatus(relativePath));
207209
}
208210
}

LibGit2Sharp.Tests/app.config

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<runtime>
4-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5-
<dependentAssembly>
6-
<assemblyIdentity name="xunit" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-1.9.2.1705" newVersion="1.9.2.1705" />
8-
</dependentAssembly>
9-
</assemblyBinding>
10-
</runtime>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
5+
</startup>
116
</configuration>

0 commit comments

Comments
 (0)