From e63bc62a69a7d9697e0003b5e31393e8e2cbed1b Mon Sep 17 00:00:00 2001 From: cyhhao Date: Wed, 14 Dec 2022 02:16:27 +0800 Subject: [PATCH] fix ref head.sha!=0 --- src/git/git.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/git/git.ts b/src/git/git.ts index 37c4a20..771f817 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -136,7 +136,7 @@ class Git { pendings.push(this.putObject(obj)) } await Promise.all(pendings) - + let sha = GitUtils.refValue(src) let err = await this.wirteRef(sha, dst, force) if (!err) { @@ -160,7 +160,7 @@ class Git { } let status if (dst == "HEAD") { - status = await this.storage.setRef(`HEAD:${newSha}`, "0000000000000000000000000000000000000000") + status = await this.storage.setRef(`HEAD:${newSha}`, "0000000000000000000000000000000000001ead") } else { status = await this.storage.setRef(dst, newSha) } @@ -191,7 +191,7 @@ class Git { async get_refs(forPush: boolean): Promise { let refs = await this.storage.listRefs() for (let item of refs) { - if (item.sha == "0000000000000000000000000000000000000000") { + if (item.sha == "0000000000000000000000000000000000001ead") { item.sha = item.ref.split("HEAD:")[1] item.ref = "HEAD" }