public static string Get(GitCommitType commitType) { switch (commitType) { default: throw new NotSupportedException($"The commit type '{commitType}' is not currently supported"); case GitCommitType.PreOpenJournalEntry: return(Pre + OpenForEdit); case GitCommitType.PostOpenJournalEntry: return(Post + OpenForEdit); case GitCommitType.PreAppendJournalEntry: return(Pre + AppendJournalEntry); case GitCommitType.PostAppendJournalEntry: return(Post + AppendJournalEntry); case GitCommitType.PreNewJournalEntry: return(Pre + NewJournalEntry); case GitCommitType.PostNewJournalEntry: return(Post + NewJournalEntry); case GitCommitType.PreRenameTag: return(Pre + RenameTag); case GitCommitType.PostRenameTag: return(Post + RenameTag); case GitCommitType.Manual: return("Manual snapshot"); } }
protected void Commit(GitCommitType commitType) { #if !DEBUG try { ValidateGitRepo(); var message = GitCommitMessage.Get(commitType); CommitCore(message); } catch (TypeInitializationException e) when(e.InnerException is DllNotFoundException) { if (!_beenWarned) { WriteWarning(MissingGitBinaryWarning); _beenWarned = true; } } #endif }
public static string Get(GitCommitType commitType) { switch (commitType) { default: throw new NotSupportedException($"The commit type '{commitType}' is not currently supported"); case GitCommitType.PreNewJournalEntry: return("PRE: " + NewJournalEntry); case GitCommitType.PostNewJournalEntry: return("POST: " + NewJournalEntry); case GitCommitType.PreRenameTag: return("PRE: " + RenameTag); case GitCommitType.PostRenameTag: return("POST: " + RenameTag); case GitCommitType.Manual: return("Manual snapshot"); } }