diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index a262ce25..f5f5c34b 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -1012,6 +1012,15 @@ namespace SparkleLib { private string FormatCommitMessage () { + /// RepositoryStatus contains the following properties (all HashSet) + /// * Added ---> added and staged + /// * MergeConflict ---> + /// * Missing ---> removed but not staged + /// * Modified ---> modified but not staged + /// * Removed ---> removed and staged + /// * Staged ---> modified and staged + /// * Untracked ---> added but not staged + /// Because we create the commitmessage, we only need to consider the staged changes RepositoryStatus status = Index.Status; string file_name = ""; @@ -1028,12 +1037,12 @@ namespace SparkleLib { } - if (status.Modified.Count > 0) { + if (status.Staged.Count > 0) { - foreach (string modified in status.Modified) { + foreach (string modified in status.Staged) { file_name = modified; break; - } + } message = "/ ‘" + file_name + "’"; @@ -1044,14 +1053,14 @@ namespace SparkleLib { foreach (string removed in status.Removed) { file_name = removed; break; - } + } message = "- ‘" + file_name + "’"; } int changes_count = (status.Added.Count + - status.Modified.Count + + status.Staged.Count + status.Removed.Count); if (changes_count > 1)