コード例 #1
0
        private static GVFSService CreateService(JsonTracer tracer, string[] args)
        {
            string serviceName = args.FirstOrDefault(arg => arg.StartsWith(GVFSService.ServiceNameArgPrefix, StringComparison.OrdinalIgnoreCase));

            if (serviceName != null)
            {
                serviceName = serviceName.Substring(GVFSService.ServiceNameArgPrefix.Length);
            }
            else
            {
                serviceName = GVFSConstants.Service.ServiceName;
            }

            GVFSPlatform gvfsPlatform = GVFSPlatform.Instance;

            string logFilePath = Path.Combine(
                gvfsPlatform.GetDataRootForGVFSComponent(serviceName),
                GVFSConstants.Service.LogDirectory);

            Directory.CreateDirectory(logFilePath);

            tracer.AddLogFileEventListener(
                GVFSEnlistment.GetNewGVFSLogFileName(logFilePath, GVFSConstants.LogFileTypes.Service),
                EventLevel.Informational,
                Keywords.Any);

            string       serviceDataLocation = gvfsPlatform.GetDataRootForGVFSComponent(serviceName);
            RepoRegistry repoRegistry        = new RepoRegistry(
                tracer,
                new PhysicalFileSystem(),
                serviceDataLocation,
                new GVFSMountProcess(tracer));

            return(new GVFSService(tracer, serviceName, repoRegistry));
        }
コード例 #2
0
        private GVFSEnlistment CreateEnlistment(string enlistmentRootPath)
        {
            GVFSPlatform.Register(new WindowsPlatform());
            string gitBinPath = GVFSPlatform.Instance.GitInstallation.GetInstalledGitBinPath();
            string hooksPath  = ProcessHelper.WhereDirectory(GVFSConstants.GVFSHooksExecutableName);

            return(GVFSEnlistment.CreateFromDirectory(enlistmentRootPath, gitBinPath, hooksPath));
        }
コード例 #3
0
 public static void Initialize()
 {
     GVFSPlatform.Register(new WindowsPlatform());
 }
 public static void Initialize()
 {
     GVFSPlatform.Register(new LinuxPlatform());
 }
コード例 #5
0
 public void SetUp()
 {
     GVFSPlatform.Register(new MockPlatform());
 }
コード例 #6
0
 public static void Initialize()
 {
     GVFSPlatform.Register(new MacPlatform());
     return;
 }