fix: don't reverse commit order when cherry-picking (#736)

Fixes #726.  Looks like a980cc987d isn't sufficient.  It sorts the commits according to the ordering in history,  but then CherryPick ViewModel reverses the order.

This commit changes CherryPick ViewModel to use string.Join on the commit list without reordering,  so that the ordering is controlled entirely by the caller.
This commit is contained in:
Dmitrij D. Czarkoff 2024-11-24 01:32:47 +00:00 committed by GitHub
parent cd96a28545
commit 546f628470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,13 +85,9 @@ namespace SourceGit.ViewModels
}
else
{
var builder = new StringBuilder();
for (int i = Targets.Count - 1; i >= 0; i--)
builder.Append($"{Targets[i].SHA} ");
succ = new Commands.CherryPick(
_repo.FullPath,
builder.ToString(),
string.Join(' ', Targets.ConvertAll(c => c.SHA)),
!AutoCommit,
AppendSourceToMessage,
string.Empty).Exec();