提交 ca58c21b 编写于 作者: J Joao Moreno

fixes #44188

上级 03f92dde
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
'use strict'; 'use strict';
import { Model } from './model'; import { Model } from './model';
import { SourceControlInputBox, Uri } from 'vscode'; import { Uri } from 'vscode';
export interface InputBox { export interface InputBox {
value: string; value: string;
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode'; import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode';
import { Ref, RefType, Git, GitErrorCodes, Branch } from './git'; import { Ref, RefType, Git, GitErrorCodes, Branch } from './git';
import { Repository, Resource, Status, CommitOptions, ResourceGroupType, RepositoryState } from './repository'; import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository';
import { Model } from './model'; import { Model } from './model';
import { toGitUri, fromGitUri } from './uri'; import { toGitUri, fromGitUri } from './uri';
import { grep, eventToPromise, isDescendant } from './util'; import { grep, isDescendant } from './util';
import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange, getModifiedRange } from './staging'; import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange, getModifiedRange } from './staging';
import * as path from 'path'; import * as path from 'path';
import { lstat, Stats } from 'fs'; import { lstat, Stats } from 'fs';
...@@ -237,7 +237,7 @@ export class CommandCenter { ...@@ -237,7 +237,7 @@ export class CommandCenter {
} }
const { size, object } = await repository.lstree(gitRef, uri.fsPath); const { size, object } = await repository.lstree(gitRef, uri.fsPath);
const { mimetype, encoding } = await repository.detectObjectType(object); const { mimetype } = await repository.detectObjectType(object);
if (mimetype === 'text/plain') { if (mimetype === 'text/plain') {
return toGitUri(uri, ref); return toGitUri(uri, ref);
...@@ -1051,13 +1051,6 @@ export class CommandCenter { ...@@ -1051,13 +1051,6 @@ export class CommandCenter {
value = (await repository.getCommit(repository.HEAD.commit)).message; value = (await repository.getCommit(repository.HEAD.commit)).message;
} }
const getPreviousCommitMessage = async () => {
//Only return the previous commit message if it's an amend commit and the repo already has a commit
if (opts && opts.amend && repository.HEAD && repository.HEAD.commit) {
return (await repository.getCommit('HEAD')).message;
}
};
return await window.showInputBox({ return await window.showInputBox({
value, value,
placeHolder: localize('commit message', "Commit message"), placeHolder: localize('commit message', "Commit message"),
......
...@@ -10,8 +10,8 @@ import * as path from 'path'; ...@@ -10,8 +10,8 @@ import * as path from 'path';
import { Repository, GitResourceGroup, Status } from './repository'; import { Repository, GitResourceGroup, Status } from './repository';
import { Model } from './model'; import { Model } from './model';
import { debounce } from './decorators'; import { debounce } from './decorators';
import { filterEvent, dispose, anyEvent, mapEvent, fireEvent } from './util'; import { filterEvent, dispose, anyEvent, fireEvent } from './util';
import { Submodule, GitErrorCodes } from './git'; import { GitErrorCodes } from './git';
type Callback = { resolve: (status: boolean) => void, reject: (err: any) => void }; type Callback = { resolve: (status: boolean) => void, reject: (err: any) => void };
......
...@@ -78,7 +78,7 @@ function _throttle<T>(fn: Function, key: string): Function { ...@@ -78,7 +78,7 @@ function _throttle<T>(fn: Function, key: string): Function {
export const throttle = decorate(_throttle); export const throttle = decorate(_throttle);
function _sequentialize<T>(fn: Function, key: string): Function { function _sequentialize(fn: Function, key: string): Function {
const currentKey = `__$sequence$${key}`; const currentKey = `__$sequence$${key}`;
return function (this: any, ...args: any[]) { return function (this: any, ...args: any[]) {
......
...@@ -362,7 +362,6 @@ function getGitErrorCode(stderr: string): string | undefined { ...@@ -362,7 +362,6 @@ function getGitErrorCode(stderr: string): string | undefined {
export class Git { export class Git {
private gitPath: string; private gitPath: string;
private version: string;
private env: any; private env: any;
private _onOutput = new EventEmitter(); private _onOutput = new EventEmitter();
...@@ -370,7 +369,6 @@ export class Git { ...@@ -370,7 +369,6 @@ export class Git {
constructor(options: IGitOptions) { constructor(options: IGitOptions) {
this.gitPath = options.gitPath; this.gitPath = options.gitPath;
this.version = options.version;
this.env = options.env || {}; this.env = options.env || {};
} }
......
...@@ -14,7 +14,7 @@ import { CommandCenter } from './commands'; ...@@ -14,7 +14,7 @@ import { CommandCenter } from './commands';
import { GitContentProvider } from './contentProvider'; import { GitContentProvider } from './contentProvider';
import { GitDecorations } from './decorationProvider'; import { GitDecorations } from './decorationProvider';
import { Askpass } from './askpass'; import { Askpass } from './askpass';
import { toDisposable, filterEvent, mapEvent, eventToPromise } from './util'; import { toDisposable, filterEvent, eventToPromise } from './util';
import TelemetryReporter from 'vscode-extension-telemetry'; import TelemetryReporter from 'vscode-extension-telemetry';
import { API, createApi } from './api'; import { API, createApi } from './api';
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
'use strict'; 'use strict';
import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, ConfigurationChangeEvent } from 'vscode'; import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento } from 'vscode';
import { Repository, RepositoryState } from './repository'; import { Repository, RepositoryState } from './repository';
import { memoize, sequentialize, debounce } from './decorators'; import { memoize, sequentialize, debounce } from './decorators';
import { dispose, anyEvent, filterEvent, IDisposable, isDescendant, find, firstIndex } from './util'; import { dispose, anyEvent, filterEvent, isDescendant, firstIndex } from './util';
import { Git, GitErrorCodes } from './git'; import { Git, GitErrorCodes } from './git';
import * as path from 'path'; import * as path from 'path';
import * as fs from 'fs'; import * as fs from 'fs';
......
...@@ -398,7 +398,7 @@ class ProgressManager { ...@@ -398,7 +398,7 @@ class ProgressManager {
private disposable: IDisposable = EmptyDisposable; private disposable: IDisposable = EmptyDisposable;
constructor(private repository: Repository) { constructor(repository: Repository) {
const start = onceEvent(filterEvent(repository.onDidChangeOperations, () => repository.operations.shouldShowProgress())); const start = onceEvent(filterEvent(repository.onDidChangeOperations, () => repository.operations.shouldShowProgress()));
const end = onceEvent(filterEvent(debounceEvent(repository.onDidChangeOperations, 300), () => !repository.operations.shouldShowProgress())); const end = onceEvent(filterEvent(debounceEvent(repository.onDidChangeOperations, 300), () => !repository.operations.shouldShowProgress()));
...@@ -790,8 +790,8 @@ export class Repository implements Disposable { ...@@ -790,8 +790,8 @@ export class Repository implements Disposable {
async buffer(ref: string, filePath: string): Promise<Buffer> { async buffer(ref: string, filePath: string): Promise<Buffer> {
return await this.run(Operation.Show, async () => { return await this.run(Operation.Show, async () => {
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/'); const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
const configFiles = workspace.getConfiguration('files', Uri.file(filePath)); // const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
const encoding = configFiles.get<string>('encoding'); // const encoding = configFiles.get<string>('encoding');
// TODO@joao: REsource config api // TODO@joao: REsource config api
return await this.repository.buffer(`${ref}:${relativePath}`); return await this.repository.buffer(`${ref}:${relativePath}`);
...@@ -1009,10 +1009,8 @@ export class Repository implements Disposable { ...@@ -1009,10 +1009,8 @@ export class Repository implements Disposable {
case 'UU': return merge.push(new Resource(ResourceGroupType.Merge, uri, Status.BOTH_MODIFIED, useIcons)); case 'UU': return merge.push(new Resource(ResourceGroupType.Merge, uri, Status.BOTH_MODIFIED, useIcons));
} }
let isModifiedInIndex = false;
switch (raw.x) { switch (raw.x) {
case 'M': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_MODIFIED, useIcons)); isModifiedInIndex = true; break; case 'M': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_MODIFIED, useIcons)); break;
case 'A': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_ADDED, useIcons)); break; case 'A': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_ADDED, useIcons)); break;
case 'D': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_DELETED, useIcons)); break; case 'D': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_DELETED, useIcons)); break;
case 'R': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_RENAMED, useIcons, renameUri)); break; case 'R': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_RENAMED, useIcons, renameUri)); break;
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"./node_modules/@types" "./node_modules/@types"
], ],
"strict": true, "strict": true,
"experimentalDecorators": true "experimentalDecorators": true,
"noUnusedLocals": true
}, },
"include": [ "include": [
"src/**/*" "src/**/*"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册