fix checkout if branch already exist

This commit is contained in:
Ashish Jain 2022-03-10 20:08:26 +01:00
parent 781b239d0d
commit 7bd9286a9b
1 changed files with 4 additions and 0 deletions

View File

@ -135,6 +135,10 @@ export const merge = function (otherBranch) {
export const checkout = function (branch) {
log.debug('in checkout');
if (!branches[branch]) {
branches[branch] = head != null ? head.id : null;
log.debug('in createBranch');
}
curBranch = branch;
const id = branches[curBranch];
head = commits[id];