Skip to content

Commit

Permalink
FIX and tag with push
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoft-wankun committed Jul 10, 2024
1 parent 73d4543 commit 5cdb29b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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]} <`);
}
Expand Down
12 changes: 10 additions & 2 deletions src/gitGraphView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5cdb29b

Please sign in to comment.