Skip to content

Commit c2ac449

Browse files
committed
Fixes from deepscan.io
1 parent 340988f commit c2ac449

File tree

7 files changed

+10
-15
lines changed

7 files changed

+10
-15
lines changed

src/annotations/annotationController.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ export class AnnotationController extends Disposable {
8989
configuration.changed(e, configuration.name('theme')('lineHighlight').value)) {
9090
Decorations.blameHighlight && Decorations.blameHighlight.dispose();
9191

92-
if (cfg === undefined) {
93-
cfg = configuration.get<IConfig>();
94-
}
92+
cfg = configuration.get<IConfig>();
93+
9594
const cfgHighlight = cfg.blame.file.lineHighlight;
9695
const cfgTheme = cfg.theme.lineHighlight;
9796

src/commands/openFileRevision.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
import { Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
33
import { AnnotationController, FileAnnotationType } from '../annotations/annotationController';
4-
import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common';
4+
import { ActiveEditorCommand, Commands, openEditor } from './common';
55
import { Logger } from '../logger';
66

77
export interface OpenFileRevisionCommandArgs {
@@ -40,8 +40,6 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
4040
}
4141

4242
async execute(editor: TextEditor, uri?: Uri, args: OpenFileRevisionCommandArgs = {}) {
43-
uri = getCommandUri(uri, editor);
44-
4543
args = { ...args };
4644
if (args.line === undefined) {
4745
args.line = editor === undefined ? 0 : editor.selection.active.line;

src/commands/openInRemote.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
import { Strings } from '../system';
33
import { TextEditor, Uri, window } from 'vscode';
4-
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
4+
import { ActiveEditorCommand, Commands } from './common';
55
import { GlyphChars } from '../constants';
66
import { GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../gitService';
77
import { Logger } from '../logger';
@@ -22,8 +22,6 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
2222
}
2323

2424
async execute(editor: TextEditor, uri?: Uri, args: OpenInRemoteCommandArgs = {}) {
25-
uri = getCommandUri(uri, editor);
26-
2725
args = { ...args };
2826
if (args.remotes === undefined || args.resource === undefined) return undefined;
2927

src/git/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function gitCommandDefaultErrorHandler(ex: Error, options: GitCommandOptions, ..
103103
if (msg) {
104104
for (const warning of GitWarnings) {
105105
if (warning.test(msg)) {
106-
Logger.warn('git', ...args, ` cwd='${options.cwd}'`, msg && `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);
106+
Logger.warn('git', ...args, ` cwd='${options.cwd}'`, `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);
107107
return '';
108108
}
109109
}

src/git/parsers/logParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class GitLogParser {
175175
}
176176
}
177177
else {
178-
next = lines.next();
178+
lines.next();
179179
next = lines.next();
180180

181181
i += 2;

src/gitService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export class GitService extends Disposable {
277277
}
278278

279279
// Can remove this try/catch once https://github.com/Microsoft/vscode/issues/38229 is fixed
280-
let depth = 1;
280+
let depth;
281281
try {
282282
depth = configuration.get<number>(configuration.name('advanced')('repositorySearchDepth').value, folderUri);
283283
}
@@ -934,7 +934,7 @@ export class GitService extends Disposable {
934934
const cachedLog = entry.get<CachedLog>('log');
935935
if (cachedLog !== undefined) {
936936
if (sha === undefined) {
937-
Logger.log(`getLogForFile[Cached(~${key})]('${repoPath}', '${fileName}', '${sha}', ${options.maxCount}, undefined, ${options.reverse}, ${options.skipMerges})`);
937+
Logger.log(`getLogForFile[Cached(~${key})]('${repoPath}', '${fileName}', '', ${options.maxCount}, undefined, ${options.reverse}, ${options.skipMerges})`);
938938
return cachedLog.item;
939939
}
940940

src/system/string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export namespace Strings {
6464

6565
export function padLeft(s: string, padTo: number, padding: string = '\u00a0') {
6666
const diff = padTo - width(s);
67-
return (diff <= 0) ? s : '\u00a0'.repeat(diff) + s;
67+
return (diff <= 0) ? s : padding.repeat(diff) + s;
6868
}
6969

7070
export function padLeftOrTruncate(s: string, max: number, padding?: string) {
@@ -76,7 +76,7 @@ export namespace Strings {
7676

7777
export function padRight(s: string, padTo: number, padding: string = '\u00a0') {
7878
const diff = padTo - width(s);
79-
return (diff <= 0) ? s : s + '\u00a0'.repeat(diff);
79+
return (diff <= 0) ? s : s + padding.repeat(diff);
8080
}
8181

8282
export function padOrTruncate(s: string, max: number, padding?: string) {

0 commit comments

Comments
 (0)