fix: SaveAsPatch for untracked changes in stash (#1366)
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions

This commit is contained in:
Gadfly 2025-05-26 22:50:29 +08:00 committed by GitHub
parent 826619e7c9
commit 729e06d5c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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