master
cyhhao 2 years ago
parent 2e5670f811
commit bb36aa8dbd

@ -177,7 +177,10 @@ const GitRemoteHelper = async ({
map(line => line.trimEnd()), map(line => line.trimEnd()),
scan( scan(
(acc, line) => { (acc, line) => {
log('Scanning #NH7FyX', JSON.stringify({ acc, line })); // console.log('')
// console.error('====')
// console.error(line)
// log('Scanning #NH7FyX', JSON.stringify({ acc, line }));
// If we emitted the last value, then we ignore all of the current lines // If we emitted the last value, then we ignore all of the current lines
// and start fresh on the next "batch" // and start fresh on the next "batch"
const linesWaitingToBeEmitted = acc.emit ? [] : acc.lines; const linesWaitingToBeEmitted = acc.emit ? [] : acc.lines;

@ -23,16 +23,16 @@ class Git {
let refs = await this.get_refs(forPush) let refs = await this.get_refs(forPush)
for (let ref of refs) { for (let ref of refs) {
if (ref.ref == "HEAD") { if (ref.ref == "HEAD") {
if (!forPush) outLines.push(`@${ref.sha} HEAD`) if (!forPush) outLines.push(`@${ref.sha} HEAD\n`)
} }
else { else {
outLines.push(`${ref.sha} ${ref.ref}`) outLines.push(`${ref.sha} ${ref.ref}\n`)
} }
this.refs.set(ref.ref, ref.sha) this.refs.set(ref.ref, ref.sha)
} }
log("outLines", outLines) log("outLines", outLines)
return outLines.join("\n") + "\n" return outLines.join("") + "\n"
} }
async do_fetch(refs: { ref: string; oid: string }[]) { async do_fetch(refs: { ref: string; oid: string }[]) {
@ -50,7 +50,7 @@ class Git {
if (ref.src == "") { if (ref.src == "") {
this.storage.delete(ref.dst) this.storage.delete(ref.dst)
} else { } else {
outLines.push(await this.push(ref.src, ref.dst)) outLines.push(await this.push(ref.src, ref.dst) + "\n")
} }
} }
if (this.refs.size == 0) { if (this.refs.size == 0) {
@ -59,7 +59,7 @@ class Git {
await this.wirteRef(symbolicRef, "HEAD", true) await this.wirteRef(symbolicRef, "HEAD", true)
} }
log("outLines", outLines) log("outLines", outLines)
return outLines.join("\n") + "\n\n" return outLines.join("") + "\n\n"
} }

Loading…
Cancel
Save