private bool TryRecreateIndex(ITracer tracer, GVFSEnlistment enlistment) { string errorMessage = null; if (!this.ShowStatusWhileRunning( () => { // Create a new index based on the new minimal modified paths using (NamedPipeServer pipeServer = AllowAllLocksNamedPipeServer.Create(tracer, enlistment)) { GitProcess git = new GitProcess(enlistment); GitProcess.Result checkoutResult = git.ForceCheckout("HEAD"); errorMessage = checkoutResult.Errors; return(!checkoutResult.HasErrors); } }, "Recreating git index", suppressGvfsLogMessage: true)) { this.WriteMessage(tracer, "Failed to recreate index: " + errorMessage); return(false); } return(true); }
private NamedPipeServer StartNamedPipe(ITracer tracer, GVFSEnlistment enlistment, out Result errorResult) { try { errorResult = new Result(true); return(AllowAllLocksNamedPipeServer.Create(tracer, enlistment)); } catch (PipeNameLengthException) { errorResult = new Result("Failed to clone. Path exceeds the maximum number of allowed characters"); return(null); } }
private bool TryRecreateIndex(ITracer tracer, GVFSEnlistment enlistment) { return(this.ShowStatusWhileRunning( () => { // Create a new index based on the new minimal sparse-checkout using (NamedPipeServer pipeServer = AllowAllLocksNamedPipeServer.Create(enlistment)) { GitProcess git = new GitProcess(enlistment); GitProcess.Result checkoutResult = git.ForceCheckout("HEAD"); return !checkoutResult.HasErrors; } }, "Recreating git index", suppressGvfsLogMessage: true)); }