Skip to content
Merged
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
14 changes: 14 additions & 0 deletions GVFS/GVFS.FunctionalTests/Tests/GitCommands/StatusTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public void ModifyingHeadRefInvalidatesCache()

private void RepositoryIgnoreTestSetup()
{
this.WaitForUpToDateStatusCache();

string statusCachePath = Path.Combine(this.Enlistment.DotGVFSRoot, "GitStatusCache", "GitStatusCache.dat");
File.Delete(statusCachePath);

Expand All @@ -110,6 +112,18 @@ private void RepositoryIgnoreTestSetup()
this.ValidateGitCommand("status");
}

/// <summary>
/// Wait for an up-to-date status cache file to exist on disk.
/// </summary>
private void WaitForUpToDateStatusCache()
{
// Run "git status" for the side effect that it will delete any stale status cache file.
this.ValidateGitCommand("status");

// Wait for a new status cache to be generated.
this.WaitForStatusCacheToBeGenerated(waitForNewFile: false);
}

private void WaitForStatusCacheToBeGenerated(bool waitForNewFile = true)
{
string statusCachePath = Path.Combine(this.Enlistment.DotGVFSRoot, "GitStatusCache", "GitStatusCache.dat");
Expand Down