Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Git to include en/sparse-checkout #1661

Closed
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion GVFS/GVFS.Build/GVFS.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup Label="Parameters">
<GVFSVersion>0.2.173.2</GVFSVersion>
<GitPackageVersion>2.20200420.2</GitPackageVersion>
<GitPackageVersion>2.20200514.1</GitPackageVersion>
</PropertyGroup>

<PropertyGroup Label="DefaultSettings">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ private void CommitChangesSwitchBranch(Action fileSystemAction, [CallerMemberNam
fileSystemAction();
this.ValidateGitCommand("status");
this.ValidateGitCommand("add .");
this.RunGitCommand("commit -m \"Change for {0}\"", test);
this.RunGitCommand($"commit -m \"Change for {test}\"");
}

private void CommitChangesSwitchBranchSwitchBack(Action fileSystemAction, [CallerMemberName]string test = GitCommandsTests.UnknownTestName)
Expand All @@ -1104,7 +1104,7 @@ private void CommitChangesSwitchBranchSwitchBack(Action fileSystemAction, [Calle
fileSystemAction();
this.ValidateGitCommand("status");
this.ValidateGitCommand("add .");
this.RunGitCommand("commit -m \"Change for {0}\"", branch);
this.RunGitCommand($"commit -m \"Change for {branch}\"");
this.ValidateGitCommand("checkout " + this.ControlGitRepo.Commitish);
this.Enlistment.RepoRoot.ShouldBeADirectory(this.FileSystem)
.WithDeepStructure(this.FileSystem, this.ControlGitRepo.RootPath, withinPrefixes: this.pathPrefixes);
Expand Down
5 changes: 0 additions & 5 deletions GVFS/GVFS.FunctionalTests/Tests/GitCommands/GitRepoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ protected void CheckHeadCommitTree()
this.ValidateGitCommand("ls-tree HEAD");
}

protected void RunGitCommand(string command, params object[] args)
{
this.RunGitCommand(string.Format(command, args));
}

/* We are using the following method for these scenarios
* 1. Some commands compute a new commit sha, which is dependent on time and therefore
* won't match what is in the control repo. For those commands, we just ensure that
Expand Down
13 changes: 0 additions & 13 deletions GVFS/GVFS.FunctionalTests/Tests/GitCommands/ResetMixedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ public void ResetMixedThenCheckoutWithConflicts()
this.FilesShouldMatchCheckoutOfTargetBranch();
}

[TestCase]
public void ResetMixedOnlyAddedThenCheckoutWithConflicts()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. This test case was modified in the second commit to change Validate... to Run..., but then the whole test was deleted in the third commit. Not sure if this was intended or what.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the commit confusion. I could not get this test to work the same because of how the (intended?) behavior changed for sparse paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While rebasing onto v2.27.0-rc0, I think I found a reason why this test would fail. I'll close this PR and work on the rebased version instead.

{
this.ValidateGitCommand("checkout " + GitRepoTests.ConflictTargetBranch);
this.ValidateGitCommand("reset --mixed HEAD~1");

// This will reset all the files except the files that were added
// and are untracked to make sure we error out with those using sparse-checkout
this.ValidateGitCommand("checkout -f");
this.ValidateGitCommand("checkout " + GitRepoTests.ConflictSourceBranch);
this.FilesShouldMatchCheckoutOfTargetBranch();
}

[TestCase]
public void ResetMixedAndCheckoutFile()
{
Expand Down