/// <summary>
 /// Generate a VersionNumber for the git repository.
 /// </summary>
 /// <param name="path">The path to the git repository.</param>
 /// <param name="branch">The name of the branch to consider when generating the version number.</param>
 /// <returns></returns>
 public static VersionNumber GenerateVersionNumber(
     string path,
     string branch)
 {
     var repo = GitRepoReader.Load(path, branch);
     return GenerateVersionNumber(repo);
 }
        /// <summary>
        /// Generate a VersionNumber for the git repository.
        /// </summary>
        /// <param name="path">The path to the git repository.</param>
        /// <param name="branch">The name of the branch to consider when generating the version number.</param>
        /// <param name="checkIfRepoIsClean">Whether or not the repository needs to be in a clean state.</param>
        /// <returns></returns>
        public static VersionNumber GenerateVersionNumber(
            string path,
            string branch,
            bool checkIfRepoIsClean)
        {
            var repo = GitRepoReader.Load(path, branch);

            if (checkIfRepoIsClean && repo.RepoIsDirty)
            {
                throw new  InvalidDataException("The repository is not in a clean state, please commit all changes or disable this check.");
            }
            return(GenerateVersionNumber(repo));
        }