feat(git): allow cherry-pick to suppress tag altogether

This commit is contained in:
Elliot Nelson
2022-09-18 09:22:35 -04:00
parent 4f96116c43
commit 4e4b5ccf8d
4 changed files with 29 additions and 2 deletions

View File

@@ -262,6 +262,10 @@ export const cherryPick = function (sourceId, targetId, tag) {
log.debug('Entering cherryPick:', sourceId, targetId, tag);
sourceId = common.sanitizeText(sourceId, configApi.getConfig());
targetId = common.sanitizeText(targetId, configApi.getConfig());
if (tag === 'cherry-pick:<id>') {
tag = 'cherry-pick:' + sourceCommit.id;
}
tag = common.sanitizeText(tag, configApi.getConfig());
if (!sourceId || typeof commits[sourceId] === 'undefined') {
@@ -330,7 +334,7 @@ export const cherryPick = function (sourceId, targetId, tag) {
parents: [head == null ? null : head.id, sourceCommit.id],
branch: curBranch,
type: commitType.CHERRY_PICK,
tag: tag ? tag : 'cherry-pick:' + sourceCommit.id,
tag: tag,
};
head = commit;
commits[commit.id] = commit;

View File

@@ -117,7 +117,7 @@ branchStatement
;
cherryPickStatement
: CHERRY_PICK COMMIT_ID STR {yy.cherryPick($3, '', '')}
: CHERRY_PICK COMMIT_ID STR {yy.cherryPick($3, '', 'cherry-pick:<id>')}
| CHERRY_PICK COMMIT_ID STR COMMIT_TAG STR {yy.cherryPick($3, '', $5)}
| CHERRY_PICK COMMIT_TAG STR COMMIT_ID STR {yy.cherryPick($5, '', $3)}
;