fix ref head.sha!=0

master
cyhhao 2 years ago
parent f4da12ac27
commit e63bc62a69

@ -160,7 +160,7 @@ class Git {
} }
let status let status
if (dst == "HEAD") { if (dst == "HEAD") {
status = await this.storage.setRef(`HEAD:${newSha}`, "0000000000000000000000000000000000000000") status = await this.storage.setRef(`HEAD:${newSha}`, "0000000000000000000000000000000000001ead")
} else { } else {
status = await this.storage.setRef(dst, newSha) status = await this.storage.setRef(dst, newSha)
} }
@ -191,7 +191,7 @@ class Git {
async get_refs(forPush: boolean): Promise<Ref[]> { async get_refs(forPush: boolean): Promise<Ref[]> {
let refs = await this.storage.listRefs() let refs = await this.storage.listRefs()
for (let item of refs) { for (let item of refs) {
if (item.sha == "0000000000000000000000000000000000000000") { if (item.sha == "0000000000000000000000000000000000001ead") {
item.sha = item.ref.split("HEAD:")[1] item.sha = item.ref.split("HEAD:")[1]
item.ref = "HEAD" item.ref = "HEAD"
} }

Loading…
Cancel
Save