Kudu.Core.SourceControl.Git.LibGit2SharpRepository.Commit C# (CSharp) Method

Commit() public method

public Commit ( string message, string authorName, string emailAddress ) : bool
message string
authorName string
emailAddress string
return bool
        public bool Commit(string message, string authorName, string emailAddress)
        {
            using (var repo = new LibGit2Sharp.Repository(RepositoryPath))
            {
                var changes = repo.RetrieveStatus(new StatusOptions
                {
                    DetectRenamesInIndex = false,
                    DetectRenamesInWorkDir = false
                }).Select(c => c.FilePath);

                if (!changes.Any())
                {
                    return false;
                }

                repo.Stage(changes);
                if (string.IsNullOrWhiteSpace(authorName) ||
                    string.IsNullOrWhiteSpace(emailAddress))
                {
                    repo.Commit(message);
                }
                else
                {
                    repo.Commit(message, new Signature(authorName, emailAddress, DateTimeOffset.UtcNow));
                }
                return true;
            }
        }