diff --git a/src/dataSource.ts b/src/dataSource.ts index 461e0626..6fbe645d 100644 --- a/src/dataSource.ts +++ b/src/dataSource.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { AskpassEnvironment, AskpassManager } from './askpass/askpassManager'; import { getConfig } from './config'; import { Logger } from './logger'; -import {ActionedUser, CommitOrdering, DateType, DeepWriteable, ErrorInfo, ErrorInfoExtensionPrefix, GitCommit, GitCommitDetails, GitCommitStash, GitConfigLocation, GitFileChange, GitFileStatus, GitPushBranchMode, GitRepoConfig, GitRepoConfigBranches, GitResetMode, GitSignature, GitSignatureStatus, GitStash, GitTagDetails, MergeActionOn, RebaseActionOn, SquashMessageFormat, TagType, Writeable } from './types'; +import { ActionedUser, CommitOrdering, DateType, DeepWriteable, ErrorInfo, ErrorInfoExtensionPrefix, GitCommit, GitCommitDetails, GitCommitStash, GitConfigLocation, GitFileChange, GitFileStatus, GitPushBranchMode, GitRepoConfig, GitRepoConfigBranches, GitResetMode, GitSignature, GitSignatureStatus, GitStash, GitTagDetails, MergeActionOn, RebaseActionOn, SquashMessageFormat, TagType, Writeable } from './types'; import { GitExecutable, GitVersionRequirement, UNABLE_TO_FIND_GIT_MSG, UNCOMMITTED, abbrevCommit, constructIncompatibleGitVersionMessage, doesVersionMeetRequirement, getPathFromStr, getPathFromUri, openGitTerminal, pathWithTrailingSlash, realpath, resolveSpawnOutput, showErrorMessage } from './utils'; import { Disposable } from './utils/disposable'; import { Event } from './utils/event'; @@ -308,7 +308,7 @@ export class DataSource extends Disposable { return { config: { branches: branches, - authors, + authors, diffTool: getConfigValue(consolidatedConfigs, GitConfigKey.DiffTool), guiDiffTool: getConfigValue(consolidatedConfigs, GitConfigKey.DiffGuiTool), pushDefault: getConfigValue(consolidatedConfigs, GitConfigKey.RemotePushDefault), @@ -1555,7 +1555,7 @@ export class DataSource extends Disposable { if (onlyFollowFirstParent) { args.push('--first-parent'); } - if(authors !== null) { + if (authors !== null) { for (let i = 0; i < authors.length; i++) { args.push(`--author=${authors[i]} <`); } diff --git a/src/gitGraphView.ts b/src/gitGraphView.ts index 9443f2c0..1cb48969 100644 --- a/src/gitGraphView.ts +++ b/src/gitGraphView.ts @@ -179,9 +179,17 @@ export class GitGraphView extends Disposable { }); break; case 'addTag': - errorInfos = [await this.dataSource.addTag(msg.repo, msg.tagName, msg.commitHash, msg.type, msg.message, msg.force, msg.withHash)]; + + let tmpTagName = msg.tagName; + + if (msg.withHash) { + // msg.tagName 拼接 + tmpTagName = tmpTagName + '.' + msg.commitHash.substring(0, 8); + } + + errorInfos = [await this.dataSource.addTag(msg.repo, tmpTagName, msg.commitHash, msg.type, msg.message, msg.force, msg.withHash)]; if (errorInfos[0] === null && msg.pushToRemote !== null) { - errorInfos.push(...await this.dataSource.pushTag(msg.repo, msg.tagName, [msg.pushToRemote], msg.commitHash, msg.pushSkipRemoteCheck)); + errorInfos.push(...await this.dataSource.pushTag(msg.repo, tmpTagName, [msg.pushToRemote], msg.commitHash, msg.pushSkipRemoteCheck)); } this.sendMessage({ command: 'addTag',