mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 22:24:22 +01:00
push rpc command draft improved
Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
@@ -121,11 +121,10 @@ async function talkToGit (refs, drive, repoName, rpc) {
|
|||||||
const publicKey = home.readPk()
|
const publicKey = home.readPk()
|
||||||
const res = await rpc.request(command, Buffer.from(`${publicKey}/${repoName}:${dst}`))
|
const res = await rpc.request(command, Buffer.from(`${publicKey}/${repoName}:${dst}`))
|
||||||
|
|
||||||
console.error('killing', daemonPid)
|
|
||||||
process.kill(daemonPid || home.getDaemonPid())
|
process.kill(daemonPid || home.getDaemonPid())
|
||||||
console.error('killed')
|
|
||||||
home.removeDaemonPid()
|
home.removeDaemonPid()
|
||||||
|
|
||||||
|
process.stdout.write(res.toString())
|
||||||
process.stdout.write('\n\n')
|
process.stdout.write('\n\n')
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
} else if (chunk && chunk.search(/^list/) !== -1) { // list && list for-push
|
} else if (chunk && chunk.search(/^list/) !== -1) { // list && list for-push
|
||||||
|
|||||||
18
src/rpc.js
18
src/rpc.js
@@ -44,24 +44,26 @@ module.exports = class RPC {
|
|||||||
|
|
||||||
pushHandler (req) {
|
pushHandler (req) {
|
||||||
// TODO: check ACL
|
// TODO: check ACL
|
||||||
// XXX: from the inside of a bare repo:
|
// collect stdout to buffer and return it
|
||||||
// git fetch url <branch>:<branch>
|
// const process = spawn('git', ['fetch', url, `${branch}:${branch}`], { env: { GIT_DIR: getCodePath(name) } })
|
||||||
console.error('req', req.toString())
|
console.error('req', req.toString())
|
||||||
console.error('pushHandler not implemented')
|
console.error('pushHandler not implemented')
|
||||||
}
|
}
|
||||||
|
|
||||||
forcePushHandler (req) {
|
forcePushHandler (req) {
|
||||||
// TODO: check ACL
|
// TODO:
|
||||||
// XXX: from the inside of a bare repo:
|
// check ACL
|
||||||
// git reset --hard url <branch>
|
// collect stdout to buffer and return it
|
||||||
|
// const process = spawn('git', ['reset', '--hard', url, branch], { env: { GIT_DIR: getCodePath(name) } })
|
||||||
console.error('req', req.toString())
|
console.error('req', req.toString())
|
||||||
console.error('forcePushHandler not implemented')
|
console.error('forcePushHandler not implemented')
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteBranchHandler (req) {
|
deleteBranchHandler (req) {
|
||||||
// TODO: check ACL
|
// TODO:
|
||||||
// XXX: from the inside of a bare repo:
|
// check ACL
|
||||||
// git push -d pear <branch>
|
// collect stdout to buffer and return it
|
||||||
|
// const process = spawn('git', ['branch', '-d', branch], { env: { GIT_DIR: getCodePath(name) } })
|
||||||
console.error('req', req.toString())
|
console.error('req', req.toString())
|
||||||
console.error('deleteBranchHandler not implemented')
|
console.error('deleteBranchHandler not implemented')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user