Skip to content

Commit

Permalink
Merge pull request #1663: Update Git to v2.27.0
Browse files Browse the repository at this point in the history
See microsoft/git#271.

Updates necessary here:

* The `multi-pack-index` builtin started honoring `repack.packKeptObjects`, which is `false` by default. We want to repack the `.keep` pack because that is just the most-recent prefetch pack-file. We don't expire it, but we want to repack it.

* The `sparse-checkout` code changed some error messages and behavior, so the `reset --mixed` tests no longer reflect an exact behavior match to vanilla Git (without sparse-checkout). Since VFS for Git dynamically sparsifies, we can't exactly match the behavior in the control repo.
  • Loading branch information
derrickstolee committed Jun 2, 2020
2 parents f14a480 + 4c2201f commit 3873e8e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion GVFS/GVFS.Build/GVFS.props
Expand Up @@ -3,7 +3,7 @@

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

<PropertyGroup Label="DefaultSettings">
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.Common/Git/GitProcess.cs
Expand Up @@ -667,7 +667,7 @@ public Result MultiPackIndexExpire(string gitObjectDirectory)

public Result MultiPackIndexRepack(string gitObjectDirectory, string batchSize)
{
return this.InvokeGitAgainstDotGitFolder($"-c pack.threads=1 multi-pack-index repack --object-dir=\"{gitObjectDirectory}\" --batch-size={batchSize} --no-progress");
return this.InvokeGitAgainstDotGitFolder($"-c pack.threads=1 -c repack.packKeptObjects=true multi-pack-index repack --object-dir=\"{gitObjectDirectory}\" --batch-size={batchSize} --no-progress");
}

public Process GetGitProcess(string command, string workingDirectory, string dotGitDirectory, bool useReadObjectHook, bool redirectStandardError, string gitObjectsDirectory)
Expand Down
13 changes: 0 additions & 13 deletions GVFS/GVFS.FunctionalTests/Tests/GitCommands/ResetMixedTests.cs
Expand Up @@ -78,19 +78,6 @@ public void ResetMixedThenCheckoutWithConflicts()
this.FilesShouldMatchCheckoutOfTargetBranch();
}

[TestCase]
public void ResetMixedOnlyAddedThenCheckoutWithConflicts()
{
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
Expand Up @@ -26,7 +26,7 @@ public class PackfileMaintenanceStepTests
private string ExpireCommand => $"multi-pack-index expire --object-dir=\"{this.context.Enlistment.GitObjectsRoot}\" --no-progress";
private string VerifyCommand => $"-c core.multiPackIndex=true multi-pack-index verify --object-dir=\"{this.context.Enlistment.GitObjectsRoot}\" --no-progress";
private string WriteCommand => $"-c core.multiPackIndex=true multi-pack-index write --object-dir=\"{this.context.Enlistment.GitObjectsRoot}\" --no-progress";
private string RepackCommand => $"-c pack.threads=1 multi-pack-index repack --object-dir=\"{this.context.Enlistment.GitObjectsRoot}\" --batch-size=2g --no-progress";
private string RepackCommand => $"-c pack.threads=1 -c repack.packKeptObjects=true multi-pack-index repack --object-dir=\"{this.context.Enlistment.GitObjectsRoot}\" --batch-size=2g --no-progress";

[TestCase]
public void PackfileMaintenanceIgnoreTimeRestriction()
Expand Down

0 comments on commit 3873e8e

Please sign in to comment.