Esempio n. 1
0
        private void AddProject(IVsHierarchy pHierarchy)
        {
            string projectName = GetProjectFileName(pHierarchy);

            if (string.IsNullOrEmpty(projectName))
            {
                return;
            }
            string projectDirecotry = Path.GetDirectoryName(projectName);

            //Debug.WriteLine("==== Adding project: " + projectDirecotry);

            string gitfolder = GitFileStatusTracker.GetRepositoryDirectory(projectDirecotry);

            if (string.IsNullOrEmpty(gitfolder) ||
                trackers.Any(t => t.HasGitRepository &&
                             string.Compare(t.GitWorkingDirectory, gitfolder, true) == 0))
            {
                return;
            }

            if (gitfolder.Length < monitorFolder.Length)
            {
                monitorFolder = gitfolder;
            }
            trackers.Add(new GitFileStatusTracker(gitfolder));

            //Debug.WriteLine("==== Added git tracker: " + gitfolder);
        }