mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
refactor: commits only hold the end position of subject in body
This commit is contained in:
parent
064d04fccc
commit
b4e01a8b93
8 changed files with 27 additions and 41 deletions
|
@ -57,17 +57,18 @@ namespace SourceGit.Commands
|
|||
if (line.Equals(_endOfBodyToken, StringComparison.Ordinal))
|
||||
{
|
||||
_nextPartIdx = 0;
|
||||
_current.Message = _messageReader.ToString().Trim();
|
||||
_messageReader.Clear();
|
||||
}
|
||||
else if (!_isSubjectSet)
|
||||
{
|
||||
_isSubjectSet = true;
|
||||
_current.Subject = line;
|
||||
_current.Body = _bodyReader.ToString().TrimEnd();
|
||||
_bodyReader.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
_messageReader.AppendLine(line);
|
||||
if (!_isSubjectSet)
|
||||
{
|
||||
_isSubjectSet = true;
|
||||
_current.SubjectLen = line.Length;
|
||||
}
|
||||
|
||||
_bodyReader.AppendLine(line);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -191,9 +192,9 @@ namespace SourceGit.Commands
|
|||
private List<Models.Commit> _commits = new List<Models.Commit>();
|
||||
private Models.Commit _current = null;
|
||||
private bool _isHeadFounded = false;
|
||||
private readonly bool _findFirstMerged = true;
|
||||
private bool _findFirstMerged = true;
|
||||
private int _nextPartIdx = 0;
|
||||
private bool _isSubjectSet = false;
|
||||
private StringBuilder _messageReader = new StringBuilder();
|
||||
private StringBuilder _bodyReader = new StringBuilder();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue