Change:
Testing Create a git stash that includes a new file, or a renamed file "View stash" The editor only shows modified files, and there is no indication that some content is missing <img width="442" alt="image" src=""<img width="305" alt="image" src=""<img width="887" alt="image" src=""
Maybe the pattern is that it only shows files that currently exist in the workspace. If I delete , then "View stash", I don't see that file either.
could you please take a look at this. I have checked and the git extensions is passing all files but it does look like the multi-file diff editor does not display all of them. Let me know if I need to change anything in the git extension. Thanks!
still seeing this, <img width="1725" alt="Screenshot 2024-01-25 at 8 31 59 AM" src=""<img width="1728" alt="Screenshot 2024-01-25 at 8 31 44 AM" src=""<img width="650" alt="Screenshot 2024-01-25 at 8 32 13 AM" src=""
when you have untracked filed you have to use the "Git: Stash (Include Untracked)" command otherwise the untracked files are not being included in the stash.

Discussion:
return; } <del> const stashFiles = await repository.showStash(stash.index); </del> <ins> const stashChanges = await repository.showStash(stash.index); </ins> <del> if (!stashFiles || stashFiles.length === 0) { </del> <ins> if (!stashChanges || stashChanges.length === 0) { </ins> return; } const title = `Git Stash #${stash.index}: ${stash.description}`; const multiDiffSourceUri = toGitUri(Uri.file(repository.root), `stash@{${stash.index}}`, { scheme: 'git-stash' }); <del> const resources: { originalUri: Uri; modifiedUri: Uri }[] = []; for (const file of stashFiles) { const fileUri = Uri.file(path.join(repository.root, file)); resources.push({ originalUri: fileUri, modifiedUri: toGitUri(fileUri, `stash@{${stash.index}}`) }); </del> <ins> const resources: { originalUri: Uri | undefined; modifiedUri: Uri | undefined }[] = []; for (const change of stashChanges) { if (change.status === Status.INDEX_ADDED) { resources.push({ originalUri: undefined, modifiedUri: toGitUri(change.uri, `stash@{${stash.index}}`) }); } else if (change.status === Status.DELETED) { resources.push({ originalUri: change.uri, modifiedUri: undefined }); } else if (change.status === Status.INDEX_RENAMED) { resources.push({ originalUri: change.originalUri, modifiedUri: toGitUri(change.uri, `stash@{${stash.index}}`) }); } else { resources.push({ originalUri: change.uri, modifiedUri: toGitUri(change.uri, `stash@{${stash.index}}`) }); } </ins> } commands.executeCommand('_workbench.openMultiDiffEditor', { multiDiffSourceUri, title, resources });

return result; } <ins> // TODO@lszomoru - adopt in diffFiles() function parseGitChanges(repositoryRoot: string, raw: string): Change[] { let index = 0; const result: Change[] = []; const segments = raw.trim() .split('x00') .filter(s => s); segmentsLoop: while (index < segments.length - 1) { const change = segments[index++]; const resourcePath = segments[index++]; if (!change || !resourcePath) { break; } const originalUri = Uri.file(path.isAbsolute(resourcePath) ? resourcePath : path.join(repositoryRoot, resourcePath)); let uri = originalUri; let renameUri = originalUri; let status = Status.UNTRACKED; // Copy or Rename status comes with a number (ex: 'R100'). // We don't need the number, we use only first character of the status. switch (change[0]) { case 'A': status = Status.INDEX_ADDED; break; case 'M': status = Status.MODIFIED; break; case 'D': status = Status.DELETED; break; // Rename contains two paths, the second one is what the file is renamed/copied to. case 'R': { if (index >= segments.length) { break; } const newPath = segments[index++]; if (!newPath) { break; } status = Status.INDEX_RENAMED; uri = renameUri = Uri.file(path.isAbsolute(newPath) ? newPath : path.join(repositoryRoot, newPath)); break; } default: // Unknown status break segmentsLoop; } result.push({ status, uri, originalUri, renameUri }); } return result; } </ins> export interface PullOptions { unshallow?: boolean; tags?: boolean;

} } <del> async showStash(index: number): Promise<string[] | undefined> { const args = ['stash', 'show', `stash@{${index}}`, '--name-only']; </del> <ins> async showStash(index: number): Promise<Change[] | undefined> { const args = ['stash', 'show', `stash@{${index}}`, '--name-status', '-z']; </ins> try { const result = await this.exec(args); <ins> if (result.exitCode) { return []; } </ins> <del> return result.stdout.trim() .split('n') .filter(line => !!line); </del> <ins> return parseGitChanges(this.repositoryRoot, result.stdout.trim()); </ins> } catch (err) { if (/No stash found/.test(err.stderr || '')) { return undefined;

return await this.run(Operation.Stash, () => this.repository.applyStash(index)); } <del> async showStash(index: number): Promise<string[] | undefined> { </del> <ins> async showStash(index: number): Promise<Change[] | undefined> { </ins> return await this.run(Operation.Stash, () => this.repository.showStash(index)); }