Update packages/mermaid/src/diagrams/git/gitGraphAst.ts

Co-authored-by: Sidharth Vinod <github@sidharth.dev>
This commit is contained in:
Austin-Fulbright 2024-07-27 04:06:09 -04:00 committed by GitHub
parent 6c1e5aae92
commit ef25160b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,16 +105,16 @@ export const commit = function (msg: string, id: string, type: number, tags?: st
export const branch = function (name: string, order?: number) { export const branch = function (name: string, order?: number) {
name = common.sanitizeText(name, getConfig()); name = common.sanitizeText(name, getConfig());
if (!state.records.branches.has(name)) { if (state.records.branches.has(name)) {
throw new Error(
`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${name}")`
);
}
state.records.branches.set(name, state.records.head != null ? state.records.head.id : null); state.records.branches.set(name, state.records.head != null ? state.records.head.id : null);
state.records.branchConfig.set(name, { name, order }); state.records.branchConfig.set(name, { name, order });
checkout(name); checkout(name);
log.debug('in createBranch'); log.debug('in createBranch');
} else {
throw new Error(
`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${name}")`
);
}
}; };
export const merge = ( export const merge = (