Przeglądaj źródła

Fixes untracked files not showing in stash list

main
Eric Amodio 7 lat temu
rodzic
commit
2c9a26e47b
7 zmienionych plików z 39 dodań i 6 usunięć
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      images/dark/icon-status-conflict.svg
  3. +6
    -0
      images/dark/icon-status-unknown.svg
  4. +1
    -1
      images/light/icon-status-conflict.svg
  5. +6
    -0
      images/light/icon-status-unknown.svg
  6. +9
    -3
      src/git/models/status.ts
  7. +15
    -1
      src/views/stashNode.ts

+ 1
- 0
CHANGELOG.md Wyświetl plik

@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes an issue where stashes with only untracked files would not show in the `Stashes` node of the GitLens custom view
- Fixes an issue where stashes with untracked files would not show its untracked files in the GitLens custom view
## [5.0.0] - 2017-09-12
### Added

+ 1
- 1
images/dark/icon-status-conflict.svg Wyświetl plik

@ -1,6 +1,6 @@
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<rect fill="#7F4E7E" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Inconsolata&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;" fill="white">
C
!
</text>
</svg>

+ 6
- 0
images/dark/icon-status-unknown.svg Wyświetl plik

@ -0,0 +1,6 @@
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<rect fill="#6C6C6C" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Inconsolata&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;" fill="white">
?
</text>
</svg>

+ 1
- 1
images/light/icon-status-conflict.svg Wyświetl plik

@ -1,6 +1,6 @@
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<rect fill="#9B4F96" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Inconsolata&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;" fill="white">
C
!
</text>
</svg>

+ 6
- 0
images/light/icon-status-unknown.svg Wyświetl plik

@ -0,0 +1,6 @@
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<rect fill="#6C6C6C" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, &quot;Droid Sans Mono&quot;, &quot;Inconsolata&quot;, &quot;Courier New&quot;, monospace, &quot;Droid Sans Fallback&quot;;" fill="white">
?
</text>
</svg>

+ 9
- 3
src/git/models/status.ts Wyświetl plik

@ -19,7 +19,7 @@ export interface GitStatus {
files: GitStatusFile[];
}
export declare type GitStatusFileStatus = '!' | '?' | 'A' | 'C' | 'D' | 'M' | 'R' | 'U';
export declare type GitStatusFileStatus = '!' | '?' | 'A' | 'C' | 'D' | 'M' | 'R' | 'T' | 'U' | 'X' | 'B';
export interface IGitStatusFile {
status: GitStatusFileStatus;
@ -71,7 +71,10 @@ const statusOcticonsMap = {
D: '$(diff-removed)',
M: '$(diff-modified)',
R: '$(diff-renamed)',
U: '$(question)'
T: '$(diff-modified)',
U: '$(alert)',
X: '$(question)',
B: '$(question)'
};
export function getGitStatusOcticon(status: GitStatusFileStatus, missing: string = GlyphChars.Space.repeat(4)): string {
@ -86,7 +89,10 @@ const statusIconsMap = {
D: 'icon-status-deleted.svg',
M: 'icon-status-modified.svg',
R: 'icon-status-renamed.svg',
U: 'icon-status-conflict.svg'
T: 'icon-status-modified.svg',
U: 'icon-status-conflict.svg',
X: 'icon-status-unknown.svg',
B: 'icon-status-unknown.svg'
};
export function getGitStatusIcon(status: GitStatusFileStatus): string {

+ 15
- 1
src/views/stashNode.ts Wyświetl plik

@ -1,4 +1,5 @@
'use strict';
import { Iterables } from '../system';
import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { ExplorerNode, ResourceType } from './explorerNode';
import { CommitFormatter, GitService, GitStashCommit, GitUri, ICommitFormatOptions } from '../gitService';
@ -13,7 +14,20 @@ export class StashNode extends ExplorerNode {
}
async getChildren(): Promise<ExplorerNode[]> {
return Promise.resolve((this.commit as GitStashCommit).fileStatuses.map(s => new StashFileNode(s, this.commit, this.context, this.git)));
const statuses = (this.commit as GitStashCommit).fileStatuses;
// Check for any untracked files -- since git doesn't return them via `git stash list` :(
const log = await this.git.getLogForRepo(this.commit.repoPath, `${(this.commit as GitStashCommit).stashName}^3`, 1);
if (log !== undefined) {
const commit = Iterables.first(log.commits.values());
if (commit !== undefined && commit.fileStatuses.length !== 0) {
// Since these files are untracked -- make them look that way
commit.fileStatuses.forEach(s => s.status = '?');
statuses.splice(statuses.length, 0, ...commit.fileStatuses);
}
}
return Promise.resolve(statuses.map(s => new StashFileNode(s, this.commit, this.context, this.git)));
}
getTreeItem(): TreeItem {

Ładowanie…
Anuluj
Zapisz