added merge commit type

This commit is contained in:
Ashish Jain 2022-03-03 19:10:34 +01:00
parent 7e041dd921
commit 56a1c27907

View File

@ -7,9 +7,6 @@ let curBranch = 'master';
let direction = 'LR'; let direction = 'LR';
let seq = 0; let seq = 0;
/**
*
*/
function getId() { function getId() {
return random({ length: 7 }); return random({ length: 7 });
} }
@ -124,6 +121,7 @@ export const merge = function (otherBranch) {
seq: seq++, seq: seq++,
parents: [head == null ? null : head.id, branches[otherBranch]], parents: [head == null ? null : head.id, branches[otherBranch]],
branch: curBranch, branch: curBranch,
type: commitType.MERGE,
}; };
head = commit; head = commit;
commits[commit.id] = commit; commits[commit.id] = commit;
@ -259,6 +257,7 @@ export const commitType = {
NORMAL: 0, NORMAL: 0,
REVERSE: 1, REVERSE: 1,
HIGHLIGHT: 2, HIGHLIGHT: 2,
MERGE: 3,
}; };
export default { export default {