mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Git - add "Stashes" node to the repositories view (#279400)
* WIP - Initial implementation * Get author and committer date for a stash * Add drop stash command * More cleanup
This commit is contained in:
@@ -8,6 +8,7 @@ import { dirname, normalize, sep, relative } from 'path';
|
||||
import { Readable } from 'stream';
|
||||
import { promises as fs, createReadStream } from 'fs';
|
||||
import byline from 'byline';
|
||||
import { Stash } from './git';
|
||||
|
||||
export const isMacintosh = process.platform === 'darwin';
|
||||
export const isWindows = process.platform === 'win32';
|
||||
@@ -846,3 +847,19 @@ export function extractFilePathFromArgs(argv: string[], startIndex: number): str
|
||||
// leading quote and return the path as-is
|
||||
return path.slice(1);
|
||||
}
|
||||
|
||||
export function getStashDescription(stash: Stash): string | undefined {
|
||||
if (!stash.commitDate && !stash.branchName) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const descriptionSegments: string[] = [];
|
||||
if (stash.commitDate) {
|
||||
descriptionSegments.push(fromNow(stash.commitDate));
|
||||
}
|
||||
if (stash.branchName) {
|
||||
descriptionSegments.push(stash.branchName);
|
||||
}
|
||||
|
||||
return descriptionSegments.join(' \u2022 ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user