fix: don't reverse commit order when cherry-picking

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 02:18:45 +01:00
parent cd96a28545
commit d4584b2df2
No known key found for this signature in database

View file

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