8000 Remove SetIgnoreCaseOrSkip test helper · SinghVarun/libgit2sharp@ba6e5c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba6e5c9

Browse files
committed
Remove SetIgnoreCaseOrSkip test helper
1 parent fb13e4e commit ba6e5c9

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

LibGit2Sharp.Tests/StageFixture.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,18 @@ public void CanStageANewFileInAPersistentManner()
158158
[InlineData(true)]
159159
public void CanStageANewFileWithAFullPath(bool ignorecase)
160160
{
161+
InconclusiveIf(() => IsFileSystemCaseSensitive && ignorecase,
162+
"Skipping 'ignorecase = true' test on case-sensitive file system.");
163+
161164
string path = CloneStandardTestRepo();
162-
SetIgnoreCaseOrSkip(path, ignorecase);
163165

164166
using (var repo = new Repository(path))
165167
{
166-
int count = repo.Index.Count;
168+
repo.Config.Set("core.ignorecase", ignorecase);
169+
}
167170

171+
using (var repo = new Repository(path))
172+
{
168173
const string filename = "new_untracked_file.txt";
169174
string fullPath = Path.Combine(repo.Info.WorkingDirectory, filename);
170175
Assert.True(File.Exists(fullPath));

LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void Dispose()
149149
}
150150
}
151151

152-
protected void InconclusiveIf(Func<bool> predicate, string message)
152+
protected static void InconclusiveIf(Func<bool> predicate, string message)
153153
{
154154
if (!predicate())
155155
{
@@ -166,18 +166,6 @@ protected static void AssertValueInConfigFile(string configFilePath, string rege
166166
Assert.True(r.Success, text);
167167
}
168168

169-
protected static void SetIgnoreCaseOrSkip(string path, bool ignorecase)
170-
{
171-
var canIgnoreCase = Directory.Exists(path.ToUpperInvariant()) && Directory.Exists(path.ToLowerInvariant());
172-
if (!canIgnoreCase && ignorecase)
173-
throw new SkipException("Skipping 'ignorecase = true' test on case-sensitive file system.");
174-
175-
using (var repo = new Repository(path))
176-
{
177-
repo.Config.Set("core.ignorecase", ignorecase);
178-
}
179-
}
180-
181169
public RepositoryOptions BuildFakeConfigs(SelfCleaningDirectory scd)
182170
{
183171
var options = BuildFakeRepositoryOptions(scd);

0 commit comments

Comments
 (0)
0