fix: Display all parents even if there are more then 2 (#583)

This commit is contained in:
Dmitrij D. Czarkoff 2024-10-21 07:38:30 +00:00 committed by GitHub
parent 67b6a6d9d5
commit bb6ceb03b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 18 deletions

View file

@ -112,15 +112,7 @@ namespace SourceGit.Commands
if (data.Length < 8) if (data.Length < 8)
return; return;
var idx = data.IndexOf(' ', StringComparison.Ordinal); _current.Parents.AddRange(data.Split(separator: ' ', options: StringSplitOptions.RemoveEmptyEntries));
if (idx == -1)
{
_current.Parents.Add(data);
return;
}
_current.Parents.Add(data.Substring(0, idx));
_current.Parents.Add(data.Substring(idx + 1));
} }
private void MarkFirstMerged() private void MarkFirstMerged()

View file

@ -73,15 +73,7 @@ namespace SourceGit.Commands
if (data.Length < 8) if (data.Length < 8)
return; return;
var idx = data.IndexOf(' ', StringComparison.Ordinal); _current.Commit.Parents.AddRange(data.Split(separator: ' ', options: StringSplitOptions.RemoveEmptyEntries));
if (idx == -1)
{
_current.Commit.Parents.Add(data);
return;
}
_current.Commit.Parents.Add(data.Substring(0, idx));
_current.Commit.Parents.Add(data.Substring(idx + 1));
} }
private List<Models.CommitWithMessage> _commits = new List<Models.CommitWithMessage>(); private List<Models.CommitWithMessage> _commits = new List<Models.CommitWithMessage>();