Skip to content

Commit 0a6303e

Browse files
committed
More test stabilization against git2 temp file
1 parent bab3051 commit 0a6303e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/NerdBank.GitVersioning.Tests/ReleaseManagerTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ public void PrepareRelease_MasterWithVersionDecrement(string initialVersion, str
377377
public void PrepareRelease_DetachedHead()
378378
{
379379
this.InitializeSourceControl();
380-
this.Ignore_git2_UntrackedFile();
381380
this.WriteVersionFile("1.0", "-alpha");
382381
Commands.Checkout(this.Repo, this.Repo.Head.Commits.First());
383382
var ex = Assert.Throws<ReleasePreparationException>(() => new ReleaseManager().PrepareRelease(this.RepoPath));
@@ -553,6 +552,12 @@ public void PrepareRelease_JsonOutputWhenUpdatingReleaseBranch()
553552
}
554553
}
555554

555+
protected override void InitializeSourceControl()
556+
{
557+
base.InitializeSourceControl();
558+
this.Ignore_git2_UntrackedFile();
559+
}
560+
556561
private void AssertError(Action testCode, ReleasePreparationError expectedError)
557562
{
558563
var ex = Assert.Throws<ReleasePreparationException>(testCode);

src/NerdBank.GitVersioning.Tests/RepoTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected virtual void Dispose(bool disposing)
6868
}
6969
}
7070

71-
protected void InitializeSourceControl()
71+
protected virtual void InitializeSourceControl()
7272
{
7373
Repository.Init(this.RepoPath);
7474
this.Repo = new Repository(this.RepoPath);

0 commit comments

Comments
 (0)