Skip to content

Use gvfs-helper to download initial commit#232

Merged
derrickstolee merged 6 commits intomicrosoft:masterfrom
derrickstolee:gvfs-helper-commit
Nov 13, 2019
Merged

Use gvfs-helper to download initial commit#232
derrickstolee merged 6 commits intomicrosoft:masterfrom
derrickstolee:gvfs-helper-commit

Conversation

@derrickstolee
Copy link
Contributor

We still have code for the gvfs/objects endpoint due to downloading the initial commit at clone time. We can instead ask the git gvfs-helper to make a POST request on that commit, which reduces our code significantly.

Also remove size endpoint details while we are here.

See microsoft/git#221 for the Git changes required.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee marked this pull request as ready for review November 13, 2019 12:29
@derrickstolee derrickstolee marked this pull request as ready for review November 13, 2019 13:20
@derrickstolee
Copy link
Contributor Author

/azp run microsoft.scalar

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Some tests use OpenFileAndWriteWithoutClose() as a way to check if
our Git commands behave the same. However, if the filestream is
disposed before the command runs, then we can get a situation where the
behavior changes.

By returning a "signalDone" action, we can keep a pointer to the
stream alive, then close it at the appropriate time.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee changed the title [PR Build] Use gvfs-helper to download initial commit Use gvfs-helper to download initial commit Nov 13, 2019
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Copy link
Member

@wilbaker wilbaker left a comment

Choose a reason for hiding this comment

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

Approved with a small question

Path.Combine(this.enlistment.WorkingDirectoryBackingRoot, ScalarConstants.DotGit.Head),
"ref: refs/heads/" + this.Branch);

if (!this.TryDownloadRootGitAttributes(this.enlistment, this.gitObjects, out errorMessage))
Copy link
Member

Choose a reason for hiding this comment

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

Why is this no longer required? (With Scalar is it enough to have any file in the root?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

VFS for Git requires the attributes file to exist so Git doesn't munge files somehow. We are not virtualizing, so we don't need it. The first git checkout will lay out all of the files at root for us.

@derrickstolee
Copy link
Contributor Author

I'm going to merge this one quickly because it has the fix for the flaky test. If anyone has late comments, I will follow-up.

@derrickstolee derrickstolee merged commit 9812441 into microsoft:master Nov 13, 2019
@derrickstolee derrickstolee deleted the gvfs-helper-commit branch November 18, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants