Skip to content

Commit

Permalink
Fixes cache mutation on filtered stashes
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 11, 2024
1 parent 446f6cc commit 839131a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/env/node/git/localGitProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5106,6 +5106,9 @@ export class LocalGitProvider implements GitProvider, Disposable {

// Return only reachable stashes from the given ref
if (options?.reachableFrom && gitStash?.stashes.size) {
// Create a copy because we are going to modify it and we don't want to mutate the cache
gitStash = { ...gitStash, stashes: new Map(gitStash.stashes) };

const oldestStashDate = new Date(min(gitStash.stashes.values(), c => c.date.getTime())).toISOString();

const ancestors = await this.git.rev_list(repoPath, options.reachableFrom, { since: oldestStashDate });
Expand Down

0 comments on commit 839131a

Please sign in to comment.