Skip to content

Commit 2a40f8e

Browse files
committed
ResetMixedTests: make test more flexible around sparse-checkout
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
1 parent 8ceba98 commit 2a40f8e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

GVFS/GVFS.FunctionalTests/Tests/GitCommands/ResetMixedTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ public void ResetMixedOnlyAddedThenCheckoutWithConflicts()
8585
this.ValidateGitCommand("reset --mixed HEAD~1");
8686

8787
// This will reset all the files except the files that were added
88-
// and are untracked to make sure we error out with those using sparse-checkout
88+
// and are untracked to make sure we error out with those using sparse-checkout.
89+
// However, a sparse-checkout-enabled repo uses a different warning
90+
// message and leaves the repo in a different state than the control repo.
8991
this.ValidateGitCommand("checkout -f");
90-
this.ValidateGitCommand("checkout " + GitRepoTests.ConflictSourceBranch);
92+
this.RunGitCommand("checkout " + GitRepoTests.ConflictSourceBranch, ignoreErrors: true, checkStatus: false);
93+
this.ValidateGitCommand("reset --hard");
9194
this.FilesShouldMatchCheckoutOfTargetBranch();
9295
}
9396

0 commit comments

Comments
 (0)