fix: SaveAsPatch for untracked changes in stash (#1366)

This commit is contained in:
Gadfly
2025-05-26 22:50:29 +08:00
committed by GitHub
parent 826619e7c9
commit 729e06d5c0

View File

@@ -180,7 +180,7 @@ namespace SourceGit.ViewModels
var opts = new List<Models.DiffOption>();
foreach (var c in _changes)
{
if (c.Index == Models.ChangeState.Added && _selectedStash.Parents.Count == 3)
if (_untracked.Contains(c))
opts.Add(new Models.DiffOption(Models.Commit.EmptyTreeSHA1, _selectedStash.Parents[2], c));
else
opts.Add(new Models.DiffOption(_selectedStash.Parents[0], _selectedStash.SHA, c));