瀏覽代碼

Fixes from deepscan.io

main
Eric Amodio 7 年之前
父節點
當前提交
c2ac4498ef
共有 7 個文件被更改,包括 10 次插入15 次删除
  1. +2
    -3
      src/annotations/annotationController.ts
  2. +1
    -3
      src/commands/openFileRevision.ts
  3. +1
    -3
      src/commands/openInRemote.ts
  4. +1
    -1
      src/git/git.ts
  5. +1
    -1
      src/git/parsers/logParser.ts
  6. +2
    -2
      src/gitService.ts
  7. +2
    -2
      src/system/string.ts

+ 2
- 3
src/annotations/annotationController.ts 查看文件

@ -89,9 +89,8 @@ export class AnnotationController extends Disposable {
configuration.changed(e, configuration.name('theme')('lineHighlight').value)) {
Decorations.blameHighlight && Decorations.blameHighlight.dispose();
if (cfg === undefined) {
cfg = configuration.get<IConfig>();
}
cfg = configuration.get<IConfig>();
const cfgHighlight = cfg.blame.file.lineHighlight;
const cfgTheme = cfg.theme.lineHighlight;

+ 1
- 3
src/commands/openFileRevision.ts 查看文件

@ -1,7 +1,7 @@
'use strict';
import { Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
import { AnnotationController, FileAnnotationType } from '../annotations/annotationController';
import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common';
import { ActiveEditorCommand, Commands, openEditor } from './common';
import { Logger } from '../logger';
export interface OpenFileRevisionCommandArgs {
@ -40,8 +40,6 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
}
async execute(editor: TextEditor, uri?: Uri, args: OpenFileRevisionCommandArgs = {}) {
uri = getCommandUri(uri, editor);
args = { ...args };
if (args.line === undefined) {
args.line = editor === undefined ? 0 : editor.selection.active.line;

+ 1
- 3
src/commands/openInRemote.ts 查看文件

@ -1,7 +1,7 @@
'use strict';
import { Strings } from '../system';
import { TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
import { ActiveEditorCommand, Commands } from './common';
import { GlyphChars } from '../constants';
import { GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../gitService';
import { Logger } from '../logger';
@ -22,8 +22,6 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
}
async execute(editor: TextEditor, uri?: Uri, args: OpenInRemoteCommandArgs = {}) {
uri = getCommandUri(uri, editor);
args = { ...args };
if (args.remotes === undefined || args.resource === undefined) return undefined;

+ 1
- 1
src/git/git.ts 查看文件

@ -103,7 +103,7 @@ function gitCommandDefaultErrorHandler(ex: Error, options: GitCommandOptions, ..
if (msg) {
for (const warning of GitWarnings) {
if (warning.test(msg)) {
Logger.warn('git', ...args, ` cwd='${options.cwd}'`, msg && `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);
Logger.warn('git', ...args, ` cwd='${options.cwd}'`, `\n ${msg.replace(/\r?\n|\r/g, ' ')}`);
return '';
}
}

+ 1
- 1
src/git/parsers/logParser.ts 查看文件

@ -175,7 +175,7 @@ export class GitLogParser {
}
}
else {
next = lines.next();
lines.next();
next = lines.next();
i += 2;

+ 2
- 2
src/gitService.ts 查看文件

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

+ 2
- 2
src/system/string.ts 查看文件

@ -64,7 +64,7 @@ export namespace Strings {
export function padLeft(s: string, padTo: number, padding: string = '\u00a0') {
const diff = padTo - width(s);
return (diff <= 0) ? s : '\u00a0'.repeat(diff) + s;
return (diff <= 0) ? s : padding.repeat(diff) + s;
}
export function padLeftOrTruncate(s: string, max: number, padding?: string) {
@ -76,7 +76,7 @@ export namespace Strings {
export function padRight(s: string, padTo: number, padding: string = '\u00a0') {
const diff = padTo - width(s);
return (diff <= 0) ? s : s + '\u00a0'.repeat(diff);
return (diff <= 0) ? s : s + padding.repeat(diff);
}
export function padOrTruncate(s: string, max: number, padding?: string) {

Loading…
取消
儲存