mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
25
src/rpc.js
25
src/rpc.js
@@ -43,17 +43,42 @@ module.exports = class RPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pushHandler (req) {
|
pushHandler (req) {
|
||||||
|
// TODO: check ACL
|
||||||
|
// XXX: from the inside of a bare repo:
|
||||||
|
// git fetch url <branch>:<branch>
|
||||||
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
|
||||||
|
// XXX: from the inside of a bare repo:
|
||||||
|
// git reset --hard url <branch>
|
||||||
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
|
||||||
|
// XXX: from the inside of a bare repo:
|
||||||
|
// git push -d pear <branch>
|
||||||
console.error('req', req.toString())
|
console.error('req', req.toString())
|
||||||
console.error('deleteBranchHandler not implemented')
|
console.error('deleteBranchHandler not implemented')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parsePushCommand(req) {
|
||||||
|
const [url, branch] = req.toString().split(':')
|
||||||
|
const [key, repo] = url.split('/')
|
||||||
|
return {
|
||||||
|
url: `pear://${url}`,
|
||||||
|
repo,
|
||||||
|
key,
|
||||||
|
branch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadACL(repoName) {
|
||||||
|
// TODO: read contact of .git-daemon-export-ok
|
||||||
|
// find key and its permissions
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user