mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 22:24:22 +01:00
identify delete and force flags
Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
@@ -70,22 +70,16 @@ async function talkToGit (refs, drive) {
|
|||||||
process.stdin.on('readable', async function () {
|
process.stdin.on('readable', async function () {
|
||||||
const chunk = process.stdin.read()
|
const chunk = process.stdin.read()
|
||||||
if (chunk === 'capabilities\n') {
|
if (chunk === 'capabilities\n') {
|
||||||
process.stdout.write('list\n') // TODO: support push
|
process.stdout.write('list\n')
|
||||||
process.stdout.write('push\n') // TODO: support push
|
process.stdout.write('push\n')
|
||||||
process.stdout.write('fetch\n\n')
|
process.stdout.write('fetch\n\n')
|
||||||
} else if (chunk && chunk.search(/^push/) !== -1) {
|
} else if (chunk && chunk.search(/^push/) !== -1) {
|
||||||
let [src, dst] = chunk.split(':')
|
const [_command, path] = chunk.split(' ')
|
||||||
src = src.split(' ')[1]
|
const [src, dst] = path.split(':')
|
||||||
const isForce = src.startsWith('+')
|
|
||||||
if (isForce) {
|
const isDelete = !src
|
||||||
src = src.slice(1)
|
const isForce = src.startsWith('+')
|
||||||
console.warn('force push is disabled')
|
|
||||||
process.stdout.write('\n\n')
|
|
||||||
process.exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: write to something
|
|
||||||
console.warn('src:', src, 'dst:', dst)
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user