fix: SaveAsPatch for untracked changes in stash

This commit is contained in:
Gadfly 2025-05-26 22:28:22 +08:00
parent 826619e7c9
commit 1776be6776
No known key found for this signature in database

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));