Skip to content

Commit ca58c21

Browse files
committed
1 parent 03f92dd commit ca58c21

9 files changed

Lines changed: 16 additions & 26 deletions

File tree

extensions/git/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
import { Model } from './model';
9-
import { SourceControlInputBox, Uri } from 'vscode';
9+
import { Uri } from 'vscode';
1010

1111
export interface InputBox {
1212
value: string;

extensions/git/src/commands.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode';
99
import { Ref, RefType, Git, GitErrorCodes, Branch } from './git';
10-
import { Repository, Resource, Status, CommitOptions, ResourceGroupType, RepositoryState } from './repository';
10+
import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository';
1111
import { Model } from './model';
1212
import { toGitUri, fromGitUri } from './uri';
13-
import { grep, eventToPromise, isDescendant } from './util';
13+
import { grep, isDescendant } from './util';
1414
import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange, getModifiedRange } from './staging';
1515
import * as path from 'path';
1616
import { lstat, Stats } from 'fs';
@@ -237,7 +237,7 @@ export class CommandCenter {
237237
}
238238

239239
const { size, object } = await repository.lstree(gitRef, uri.fsPath);
240-
const { mimetype, encoding } = await repository.detectObjectType(object);
240+
const { mimetype } = await repository.detectObjectType(object);
241241

242242
if (mimetype === 'text/plain') {
243243
return toGitUri(uri, ref);
@@ -1051,13 +1051,6 @@ export class CommandCenter {
10511051
value = (await repository.getCommit(repository.HEAD.commit)).message;
10521052
}
10531053

1054-
const getPreviousCommitMessage = async () => {
1055-
//Only return the previous commit message if it's an amend commit and the repo already has a commit
1056-
if (opts && opts.amend && repository.HEAD && repository.HEAD.commit) {
1057-
return (await repository.getCommit('HEAD')).message;
1058-
}
1059-
};
1060-
10611054
return await window.showInputBox({
10621055
value,
10631056
placeHolder: localize('commit message', "Commit message"),

extensions/git/src/decorationProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import * as path from 'path';
1010
import { Repository, GitResourceGroup, Status } from './repository';
1111
import { Model } from './model';
1212
import { debounce } from './decorators';
13-
import { filterEvent, dispose, anyEvent, mapEvent, fireEvent } from './util';
14-
import { Submodule, GitErrorCodes } from './git';
13+
import { filterEvent, dispose, anyEvent, fireEvent } from './util';
14+
import { GitErrorCodes } from './git';
1515

1616
type Callback = { resolve: (status: boolean) => void, reject: (err: any) => void };
1717

extensions/git/src/decorators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function _throttle<T>(fn: Function, key: string): Function {
7878

7979
export const throttle = decorate(_throttle);
8080

81-
function _sequentialize<T>(fn: Function, key: string): Function {
81+
function _sequentialize(fn: Function, key: string): Function {
8282
const currentKey = `__$sequence$${key}`;
8383

8484
return function (this: any, ...args: any[]) {

extensions/git/src/git.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,13 @@ function getGitErrorCode(stderr: string): string | undefined {
362362
export class Git {
363363

364364
private gitPath: string;
365-
private version: string;
366365
private env: any;
367366

368367
private _onOutput = new EventEmitter();
369368
get onOutput(): EventEmitter { return this._onOutput; }
370369

371370
constructor(options: IGitOptions) {
372371
this.gitPath = options.gitPath;
373-
this.version = options.version;
374372
this.env = options.env || {};
375373
}
376374

extensions/git/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { CommandCenter } from './commands';
1414
import { GitContentProvider } from './contentProvider';
1515
import { GitDecorations } from './decorationProvider';
1616
import { Askpass } from './askpass';
17-
import { toDisposable, filterEvent, mapEvent, eventToPromise } from './util';
17+
import { toDisposable, filterEvent, eventToPromise } from './util';
1818
import TelemetryReporter from 'vscode-extension-telemetry';
1919
import { API, createApi } from './api';
2020

extensions/git/src/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
'use strict';
77

8-
import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, ConfigurationChangeEvent } from 'vscode';
8+
import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento } from 'vscode';
99
import { Repository, RepositoryState } from './repository';
1010
import { memoize, sequentialize, debounce } from './decorators';
11-
import { dispose, anyEvent, filterEvent, IDisposable, isDescendant, find, firstIndex } from './util';
11+
import { dispose, anyEvent, filterEvent, isDescendant, firstIndex } from './util';
1212
import { Git, GitErrorCodes } from './git';
1313
import * as path from 'path';
1414
import * as fs from 'fs';

extensions/git/src/repository.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class ProgressManager {
398398

399399
private disposable: IDisposable = EmptyDisposable;
400400

401-
constructor(private repository: Repository) {
401+
constructor(repository: Repository) {
402402
const start = onceEvent(filterEvent(repository.onDidChangeOperations, () => repository.operations.shouldShowProgress()));
403403
const end = onceEvent(filterEvent(debounceEvent(repository.onDidChangeOperations, 300), () => !repository.operations.shouldShowProgress()));
404404

@@ -790,8 +790,8 @@ export class Repository implements Disposable {
790790
async buffer(ref: string, filePath: string): Promise<Buffer> {
791791
return await this.run(Operation.Show, async () => {
792792
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
793-
const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
794-
const encoding = configFiles.get<string>('encoding');
793+
// const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
794+
// const encoding = configFiles.get<string>('encoding');
795795

796796
// TODO@joao: REsource config api
797797
return await this.repository.buffer(`${ref}:${relativePath}`);
@@ -1009,10 +1009,8 @@ export class Repository implements Disposable {
10091009
case 'UU': return merge.push(new Resource(ResourceGroupType.Merge, uri, Status.BOTH_MODIFIED, useIcons));
10101010
}
10111011

1012-
let isModifiedInIndex = false;
1013-
10141012
switch (raw.x) {
1015-
case 'M': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_MODIFIED, useIcons)); isModifiedInIndex = true; break;
1013+
case 'M': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_MODIFIED, useIcons)); break;
10161014
case 'A': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_ADDED, useIcons)); break;
10171015
case 'D': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_DELETED, useIcons)); break;
10181016
case 'R': index.push(new Resource(ResourceGroupType.Index, uri, Status.INDEX_RENAMED, useIcons, renameUri)); break;

extensions/git/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"./node_modules/@types"
1111
],
1212
"strict": true,
13-
"experimentalDecorators": true
13+
"experimentalDecorators": true,
14+
"noUnusedLocals": true
1415
},
1516
"include": [
1617
"src/**/*"

0 commit comments

Comments
 (0)