Skip to content
Merged
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
6 changes: 0 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ Note that Scalar on Mac is under active development.
git clone https://github.com/microsoft/scalar.git src
```

* Using XCode, open `Scalar/ReadObjectHook/Scalar.ReadObjectHook.Mac.xcodeproj`.

* Select the `Scalar.ReadObjectHook.Mac` project.
* Under "Signing", select your developer certificate, which may be an organization
certificate.

* Run the build and installation scripts:

```
Expand Down
2 changes: 1 addition & 1 deletion Scalar.Build/Scalar.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup Label="Parameters">
<ScalarVersion>0.2.173.2</ScalarVersion>
<GitPackageVersion>2.20191002.1-sc</GitPackageVersion>
<GitPackageVersion>2.20191003.3-sc</GitPackageVersion>
</PropertyGroup>

<PropertyGroup Label="DefaultSettings">
Expand Down
199 changes: 0 additions & 199 deletions Scalar.Common/FileSystem/HooksInstaller.cs

This file was deleted.

1 change: 0 additions & 1 deletion Scalar.Common/Git/GitConfigSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace Scalar.Common.Git
{
public class GitConfigSetting
{
public const string CoreVirtualizeObjectsName = "core.virtualizeobjects";
public const string CredentialUseHttpPath = "credential.\"https://dev.azure.com\".useHttpPath";

public const string HttpSslCert = "http.sslcert";
Expand Down
40 changes: 23 additions & 17 deletions Scalar.Common/Git/GitProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static Result Init(Enlistment enlistment)

public static Result SparseCheckoutInit(Enlistment enlistment)
{
return new GitProcess(enlistment).InvokeGitInWorkingDirectoryRoot("sparse-checkout init --cone", useReadObjectHook: false);
return new GitProcess(enlistment).InvokeGitInWorkingDirectoryRoot("sparse-checkout init --cone", fetchMissingObjects: false);
}

public static ConfigResult GetFromGlobalConfig(string gitBinPath, string settingName)
Expand Down Expand Up @@ -413,19 +413,19 @@ public Result CreateBranchWithUpstream(string branchToCreate, string upstreamBra

public Result ForceCheckout(string target)
{
return this.InvokeGitInWorkingDirectoryRoot("checkout -f " + target, useReadObjectHook: true);
return this.InvokeGitInWorkingDirectoryRoot("checkout -f " + target, fetchMissingObjects: true);
}

public Result ForceCheckoutAllFiles()
{
return this.InvokeGitInWorkingDirectoryRoot("checkout HEAD -- .", useReadObjectHook: true);
return this.InvokeGitInWorkingDirectoryRoot("checkout HEAD -- .", fetchMissingObjects: true);
}

public Result SparseCheckoutSet(List<string> foldersToSet)
{
return this.InvokeGitInWorkingDirectoryRoot(
$"sparse-checkout set --stdin",
useReadObjectHook: true,
fetchMissingObjects: true,
writeStdIn: writer =>
{
foreach (string path in foldersToSet)
Expand All @@ -449,7 +449,7 @@ public Result Status(bool allowObjectDownloads, bool useStatusCache, bool showUn
command += " -uall";
}

return this.InvokeGitInWorkingDirectoryRoot(command, useReadObjectHook: allowObjectDownloads);
return this.InvokeGitInWorkingDirectoryRoot(command, fetchMissingObjects: allowObjectDownloads);
}

public Result UnpackObjects(Stream packFileStream)
Expand Down Expand Up @@ -490,7 +490,7 @@ public Result WriteCommitGraph(string objectDir, List<string> packs)
string command = "commit-graph write --stdin-packs --split --size-multiple=4 --object-dir \"" + objectDir + "\"";
return this.InvokeGitInWorkingDirectoryRoot(
command,
useReadObjectHook: true,
fetchMissingObjects: true,
writeStdIn: writer =>
{
foreach (string packIndex in packs)
Expand All @@ -506,7 +506,7 @@ public Result WriteCommitGraph(string objectDir, List<string> packs)
public Result VerifyCommitGraph(string objectDir)
{
string command = "commit-graph verify --shallow --object-dir \"" + objectDir + "\"";
return this.InvokeGitInWorkingDirectoryRoot(command, useReadObjectHook: true);
return this.InvokeGitInWorkingDirectoryRoot(command, fetchMissingObjects: true);
}

public Result IndexPack(string packfilePath, string idxOutputPath)
Expand Down Expand Up @@ -547,7 +547,7 @@ public Result LsFiles(Action<string> parseStdOutLine)
{
return this.InvokeGitInWorkingDirectoryRoot(
"ls-files -v",
useReadObjectHook: false,
fetchMissingObjects: false,
parseStdOutLine: parseStdOutLine);
}

Expand Down Expand Up @@ -588,7 +588,7 @@ public Result MultiPackIndexRepack(string gitObjectDirectory, string batchSize)
return this.InvokeGitAgainstDotGitFolder($"-c pack.threads=1 multi-pack-index repack --object-dir=\"{gitObjectDirectory}\" --batch-size={batchSize}");
}

public Process GetGitProcess(string command, string workingDirectory, string dotGitDirectory, bool useReadObjectHook, bool redirectStandardError, string gitObjectsDirectory)
public Process GetGitProcess(string command, string workingDirectory, string dotGitDirectory, bool fetchMissingObjects, bool redirectStandardError, string gitObjectsDirectory)
{
ProcessStartInfo processInfo = new ProcessStartInfo(this.gitBinPath);
processInfo.WorkingDirectory = workingDirectory;
Expand Down Expand Up @@ -632,9 +632,9 @@ public Process GetGitProcess(string command, string workingDirectory, string dot
processInfo.EnvironmentVariables["GIT_OBJECT_DIRECTORY"] = gitObjectsDirectory;
}

if (!useReadObjectHook)
if (!fetchMissingObjects)
{
command = "-c " + GitConfigSetting.CoreVirtualizeObjectsName + "=false " + command;
command = $"-c {ScalarConstants.GitConfig.UseGvfsHelper}=false {command}";
}

if (!string.IsNullOrEmpty(dotGitDirectory))
Expand All @@ -654,7 +654,7 @@ protected virtual Result InvokeGitImpl(
string command,
string workingDirectory,
string dotGitDirectory,
bool useReadObjectHook,
bool fetchMissingObjects,
Action<StreamWriter> writeStdIn,
Action<string> parseStdOutLine,
int timeoutMs,
Expand All @@ -670,7 +670,13 @@ protected virtual Result InvokeGitImpl(
// From https://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx
// To avoid deadlocks, use asynchronous read operations on at least one of the streams.
// Do not perform a synchronous read to the end of both redirected streams.
using (this.executingProcess = this.GetGitProcess(command, workingDirectory, dotGitDirectory, useReadObjectHook, redirectStandardError: true, gitObjectsDirectory: gitObjectsDirectory))
using (this.executingProcess = this.GetGitProcess(
command,
workingDirectory,
dotGitDirectory,
fetchMissingObjects: fetchMissingObjects,
redirectStandardError: true,
gitObjectsDirectory: gitObjectsDirectory))
{
StringBuilder output = new StringBuilder();
StringBuilder errors = new StringBuilder();
Expand Down Expand Up @@ -793,7 +799,7 @@ private Result InvokeGitOutsideEnlistment(
command,
workingDirectory: Environment.SystemDirectory,
dotGitDirectory: null,
useReadObjectHook: false,
fetchMissingObjects: false,
writeStdIn: writeStdIn,
parseStdOutLine: parseStdOutLine,
timeoutMs: timeout);
Expand All @@ -804,15 +810,15 @@ private Result InvokeGitOutsideEnlistment(
/// </summary>
private Result InvokeGitInWorkingDirectoryRoot(
string command,
bool useReadObjectHook,
bool fetchMissingObjects,
Action<StreamWriter> writeStdIn = null,
Action<string> parseStdOutLine = null)
{
return this.InvokeGitImpl(
command,
workingDirectory: this.workingDirectoryRoot,
dotGitDirectory: null,
useReadObjectHook: useReadObjectHook,
fetchMissingObjects: fetchMissingObjects,
writeStdIn: writeStdIn,
parseStdOutLine: parseStdOutLine,
timeoutMs: -1);
Expand Down Expand Up @@ -840,7 +846,7 @@ private Result InvokeGitAgainstDotGitFolder(
command,
workingDirectory: Environment.SystemDirectory,
dotGitDirectory: this.dotGitRoot,
useReadObjectHook: false,
fetchMissingObjects: false,
writeStdIn: writeStdIn,
parseStdOutLine: parseStdOutLine,
timeoutMs: -1,
Expand Down
Loading