From 2218929416b905a78c465041c1b0f73b4ad9594f Mon Sep 17 00:00:00 2001 From: Austin Fulbright Date: Thu, 8 Aug 2024 19:49:09 -0400 Subject: [PATCH] fixed types in gitGraphTypes --- packages/mermaid/src/diagrams/git/gitGraphAst.ts | 4 ++-- packages/mermaid/src/diagrams/git/gitGraphTypes.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/diagrams/git/gitGraphAst.ts b/packages/mermaid/src/diagrams/git/gitGraphAst.ts index 53c361e3e..1a40450d9 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphAst.ts +++ b/packages/mermaid/src/diagrams/git/gitGraphAst.ts @@ -213,7 +213,7 @@ export const merge = ( id: customId ? customId : state.records.seq + '-' + getID(), message: `merged branch ${otherBranch} into ${state.records.currBranch}`, seq: state.records.seq++, - parents: [state.records.head == null ? null : state.records.head.id, verifiedBranch], + parents: state.records.head == null ? [] : [state.records.head.id, verifiedBranch], branch: state.records.currBranch, type: commitType.MERGE, customType: overrideType, @@ -317,7 +317,7 @@ export const cherryPick = function ( id: state.records.seq + '-' + getID(), message: `cherry-picked ${sourceCommit?.message} into ${state.records.currBranch}`, seq: state.records.seq++, - parents: [state.records.head == null ? null : state.records.head.id, sourceCommit.id], + parents: state.records.head == null ? [] : [state.records.head.id, sourceCommit.id], branch: state.records.currBranch, type: commitType.CHERRY_PICK, tags: tags diff --git a/packages/mermaid/src/diagrams/git/gitGraphTypes.ts b/packages/mermaid/src/diagrams/git/gitGraphTypes.ts index 0e929666f..b473dd874 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphTypes.ts +++ b/packages/mermaid/src/diagrams/git/gitGraphTypes.ts @@ -15,7 +15,7 @@ export interface Commit { seq: number; type: number; tags: string[]; - parents: (string | null)[]; + parents: string[]; branch: string; customType?: number; customId?: boolean; @@ -109,4 +109,4 @@ export interface GitGraphDB extends DiagramDB { getHead: () => Commit | null; } -export type DiagramOrientation = 'LR' | 'TB'; +export type DiagramOrientation = 'LR' | 'TB' | 'BT';