1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Make stash filtering work when filtering on a folder

This commit is contained in:
Stefan Haller
2025-07-11 16:35:29 +02:00
parent 09cbaf2cba
commit ec82e7c1e7
2 changed files with 1 additions and 4 deletions

View File

@ -56,7 +56,7 @@ outer:
currentStashEntry = stashEntryFromLine(match[2], idx) currentStashEntry = stashEntryFromLine(match[2], idx)
for i+1 < len(lines) && !isAStash(lines[i+1]) { for i+1 < len(lines) && !isAStash(lines[i+1]) {
i++ i++
if lines[i] == filterPath { if strings.HasPrefix(lines[i], filterPath) {
stashEntries = append(stashEntries, currentStashEntry) stashEntries = append(stashEntries, currentStashEntry)
continue outer continue outer
} }

View File

@ -53,11 +53,8 @@ var FilterByPath = NewIntegrationTest(NewIntegrationTestArgs{
filterBy("subdir") filterBy("subdir")
t.Views().Stash(). t.Views().Stash().
/* EXPECTED:
Lines( Lines(
Contains("subdir/file2"), Contains("subdir/file2"),
) )
ACTUAL: */
IsEmpty()
}, },
}) })