示例#1
0
        public GVFSContext(ITracer tracer, PhysicalFileSystem fileSystem, GitRepo repository, GVFSEnlistment enlistment)
        {
            this.Tracer     = tracer;
            this.FileSystem = fileSystem;
            this.Enlistment = enlistment;
            this.Repository = repository;

            this.Unattended = GVFSEnlistment.IsUnattended(this.Tracer);
        }
示例#2
0
        public static bool TryGetDefaultLocalCacheRoot(GVFSEnlistment enlistment, out string localCacheRoot, out string localCacheRootError)
        {
            if (GVFSEnlistment.IsUnattended(tracer: null))
            {
                localCacheRoot      = Path.Combine(enlistment.DotGVFSRoot, GVFSConstants.DefaultGVFSCacheFolderName);
                localCacheRootError = null;
                return(true);
            }

            return(GVFSPlatform.Instance.TryGetDefaultLocalCacheRoot(enlistment.EnlistmentRoot, out localCacheRoot, out localCacheRootError));
        }
示例#3
0
        public static string GetDefaultLocalCacheRoot(GVFSEnlistment enlistment)
        {
            string localCacheRoot;

            if (GVFSEnlistment.IsUnattended(tracer: null))
            {
                localCacheRoot = Path.Combine(enlistment.DotGVFSRoot, DefaultGVFSCacheFolderName);
            }
            else
            {
                string pathRoot = Path.GetPathRoot(enlistment.EnlistmentRoot);
                localCacheRoot = Path.Combine(pathRoot, DefaultGVFSCacheFolderName);
            }

            return(localCacheRoot);
        }
示例#4
0
        public static bool TryGetDefaultLocalCacheRoot(GVFSEnlistment enlistment, out string localCacheRoot, out string errorMessage)
        {
            localCacheRoot = null;
            errorMessage   = string.Empty;

            if (GVFSEnlistment.IsUnattended(tracer: null))
            {
                localCacheRoot = Path.Combine(enlistment.DotGVFSRoot, DefaultGVFSCacheFolderName);
            }
            else
            {
                string pathRoot;
                if (!Paths.TryGetPathRoot(enlistment.EnlistmentRoot, out pathRoot, out errorMessage))
                {
                    return(false);
                }

                localCacheRoot = Path.Combine(pathRoot, DefaultGVFSCacheFolderName);
            }

            return(true);
        }