Exemplo n.º 1
0
        private bool TryMount(ITracer tracer, GSDEnlistment enlistment, string mountExecutableLocation, out string errorMessage)
        {
            if (!GSDVerb.TrySetRequiredGitConfigSettings(enlistment))
            {
                errorMessage = "Unable to configure git repo";
                return(false);
            }

            const string ParamPrefix = "--";

            tracer.RelatedInfo($"{nameof(this.TryMount)}: Launching background process('{mountExecutableLocation}') for {enlistment.EnlistmentRoot}");

            GSDPlatform.Instance.StartBackgroundVFS4GProcess(
                tracer,
                mountExecutableLocation,
                new[]
            {
                enlistment.EnlistmentRoot,
                ParamPrefix + GSDConstants.VerbParameters.Mount.Verbosity,
                this.Verbosity,
                ParamPrefix + GSDConstants.VerbParameters.Mount.Keywords,
                this.KeywordsCsv,
                ParamPrefix + GSDConstants.VerbParameters.Mount.StartedByService,
                this.StartedByService.ToString(),
                ParamPrefix + GSDConstants.VerbParameters.Mount.StartedByVerb,
                true.ToString()
            });

            tracer.RelatedInfo($"{nameof(this.TryMount)}: Waiting for repo to be mounted");
            return(GSDEnlistment.WaitUntilMounted(tracer, enlistment.EnlistmentRoot, this.Unattended, out errorMessage));
        }
Exemplo n.º 2
0
        public bool MountRepository(string repoRoot, int sessionId)
        {
            using (CurrentUser currentUser = new CurrentUser(this.tracer, sessionId))
            {
                if (!this.CallGSDMount(repoRoot, currentUser))
                {
                    this.tracer.RelatedError($"{nameof(this.MountRepository)}: Unable to start the GSD.exe process.");
                    return(false);
                }

                string errorMessage;
                if (!GSDEnlistment.WaitUntilMounted(this.tracer, repoRoot, false, out errorMessage))
                {
                    this.tracer.RelatedError(errorMessage);
                    return(false);
                }
            }

            return(true);
        }
 public virtual bool WaitUntilMounted(ITracer tracer, string enlistmentRoot, bool unattended, out string errorMessage)
 {
     return(GSDEnlistment.WaitUntilMounted(tracer, enlistmentRoot, unattended: false, errorMessage: out errorMessage));
 }