public void InitializeRepository(NPath expectedRepositoryPath = null)
        {
            if (RepositoryPath != null && RepositoryPath.DirectoryExists(".git"))
            {
                FileSystem.SetCurrentDirectory(RepositoryPath);
                return;
            }

            Guard.NotNull(this, UnityProjectPath, nameof(UnityProjectPath));

            if (expectedRepositoryPath == null)
            {
                expectedRepositoryPath = UnityProjectPath;
            }

            Guard.NotNull(this, FileSystem, nameof(FileSystem));
            if (expectedRepositoryPath != null && expectedRepositoryPath.DirectoryExists(".git"))
            {
                RepositoryPath = expectedRepositoryPath;
                FileSystem.SetCurrentDirectory(RepositoryPath);
                return;
            }

            RepositoryPath = UnityProjectPath.RecursiveParents.FirstOrDefault(d => d.DirectoryExists(".git"));
            if (RepositoryPath == null)
            {
                FileSystem.SetCurrentDirectory(UnityProjectPath);
            }
            else
            {
                FileSystem.SetCurrentDirectory(RepositoryPath);
            }
        }