mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 16:29:40 +02:00
Use undefined to mean default tagging behavior
This commit is contained in:
@@ -262,10 +262,6 @@ export const cherryPick = function (sourceId, targetId, tag) {
|
|||||||
log.debug('Entering cherryPick:', sourceId, targetId, tag);
|
log.debug('Entering cherryPick:', sourceId, targetId, tag);
|
||||||
sourceId = common.sanitizeText(sourceId, configApi.getConfig());
|
sourceId = common.sanitizeText(sourceId, configApi.getConfig());
|
||||||
targetId = common.sanitizeText(targetId, configApi.getConfig());
|
targetId = common.sanitizeText(targetId, configApi.getConfig());
|
||||||
|
|
||||||
if (tag === 'cherry-pick:<id>') {
|
|
||||||
tag = 'cherry-pick:' + sourceCommit.id;
|
|
||||||
}
|
|
||||||
tag = common.sanitizeText(tag, configApi.getConfig());
|
tag = common.sanitizeText(tag, configApi.getConfig());
|
||||||
|
|
||||||
if (!sourceId || typeof commits[sourceId] === 'undefined') {
|
if (!sourceId || typeof commits[sourceId] === 'undefined') {
|
||||||
@@ -334,7 +330,7 @@ export const cherryPick = function (sourceId, targetId, tag) {
|
|||||||
parents: [head == null ? null : head.id, sourceCommit.id],
|
parents: [head == null ? null : head.id, sourceCommit.id],
|
||||||
branch: curBranch,
|
branch: curBranch,
|
||||||
type: commitType.CHERRY_PICK,
|
type: commitType.CHERRY_PICK,
|
||||||
tag: tag,
|
tag: tag ?? 'cherry-pick:' + sourceCommit.id,
|
||||||
};
|
};
|
||||||
head = commit;
|
head = commit;
|
||||||
commits[commit.id] = commit;
|
commits[commit.id] = commit;
|
||||||
|
@@ -117,7 +117,7 @@ branchStatement
|
|||||||
;
|
;
|
||||||
|
|
||||||
cherryPickStatement
|
cherryPickStatement
|
||||||
: CHERRY_PICK COMMIT_ID STR {yy.cherryPick($3, '', 'cherry-pick:<id>')}
|
: CHERRY_PICK COMMIT_ID STR {yy.cherryPick($3, '', undefined)}
|
||||||
| CHERRY_PICK COMMIT_ID STR COMMIT_TAG STR {yy.cherryPick($3, '', $5)}
|
| CHERRY_PICK COMMIT_ID STR COMMIT_TAG STR {yy.cherryPick($3, '', $5)}
|
||||||
| CHERRY_PICK COMMIT_TAG STR COMMIT_ID STR {yy.cherryPick($5, '', $3)}
|
| CHERRY_PICK COMMIT_TAG STR COMMIT_ID STR {yy.cherryPick($5, '', $3)}
|
||||||
;
|
;
|
||||||
|
Reference in New Issue
Block a user