mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-19 17:25:57 -05:00
Adds Apply Changes command to custom view files
Adds Stash Changes command to SCM view items
This commit is contained in:
@@ -177,6 +177,12 @@ export class Git {
|
||||
return gitCommand({ cwd: repoPath }, ...params);
|
||||
}
|
||||
|
||||
static checkout(repoPath: string, fileName: string, sha: string) {
|
||||
const [file, root] = Git.splitPath(fileName, repoPath);
|
||||
|
||||
return gitCommand({ cwd: root }, `checkout`, sha, `--`, file);
|
||||
}
|
||||
|
||||
static async config_get(key: string, repoPath?: string) {
|
||||
try {
|
||||
return await gitCommand({ cwd: repoPath || '' }, `config`, `--get`, key);
|
||||
@@ -322,11 +328,18 @@ export class Git {
|
||||
return gitCommand({ cwd: repoPath }, ...defaultStashParams);
|
||||
}
|
||||
|
||||
static stash_save(repoPath: string, message?: string, unstagedOnly: boolean = false) {
|
||||
const params = [`stash`, `save`, `--include-untracked`];
|
||||
if (unstagedOnly) {
|
||||
params.push(`--keep-index`);
|
||||
static stash_push(repoPath: string, pathspecs: string[], message?: string) {
|
||||
const params = [`stash`, `push`];
|
||||
if (message) {
|
||||
params.push(`-m`);
|
||||
params.push(message);
|
||||
}
|
||||
params.splice(params.length, 0, `--`, ...pathspecs);
|
||||
return gitCommand({ cwd: repoPath }, ...params);
|
||||
}
|
||||
|
||||
static stash_save(repoPath: string, message?: string) {
|
||||
const params = [`stash`, `save`, `--include-untracked`];
|
||||
if (message) {
|
||||
params.push(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user