fixed types in gitGraphTypes

This commit is contained in:
Austin Fulbright 2024-08-08 19:49:09 -04:00
parent 00603e7bac
commit 2218929416
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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';