Skip to content

Commit 546f628

Browse files
authored
fix: don't reverse commit order when cherry-picking (#736)
Fixes #726. Looks like a980cc9 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.
1 parent cd96a28 commit 546f628

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/ViewModels/CherryPick.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ public override Task<bool> Sure()
8585
}
8686
else
8787
{
88-
var builder = new StringBuilder();
89-
for (int i = Targets.Count - 1; i >= 0; i--)
90-
builder.Append($"{Targets[i].SHA} ");
91-
9288
succ = new Commands.CherryPick(
9389
_repo.FullPath,
94-
builder.ToString(),
90+
string.Join(' ', Targets.ConvertAll(c => c.SHA)),
9591
!AutoCommit,
9692
AppendSourceToMessage,
9793
string.Empty).Exec();

0 commit comments

Comments
 (0)