git ssb

0+

cel / pull-git-remote-helper



Tree: 16cb3742dd9d961d752709c70a7d7e0d0139c0f8

Files: 16cb3742dd9d961d752709c70a7d7e0d0139c0f8 / test / git-remote-full.js

842 bytesRaw
1#!/usr/bin/env node
2
3var toPull = require('stream-to-pull-stream')
4var pull = require('pull-stream')
5
6process.on('uncaughtException', function (err) {
7 if (err.stack)
8 err = {stack: err.stack, message: err.message}
9 process.send({error: err})
10 process.exit(1)
11})
12
13var objects = {}
14
15var ref = {value: 'edb5b50e8019797925820007d318870f8c346726'}
16var refs = {
17 'refs/heads/master': ref,
18 HEAD: ref
19}
20
21function refsSource() {
22 console.error('sending refs', refs)
23 var arr = []
24 for (var name in refs)
25 arr.push({
26 name: name,
27 value: refs[name].value,
28 attrs: refs[name].attrs
29 })
30 return pull.values(arr)
31}
32
33pull(
34 toPull(process.stdin),
35 require('../')({
36 prefix: 'foo',
37 refSource: refsSource
38 }),
39 toPull(process.stdout, function (err) {
40 if (err)
41 throw err
42 process.disconnect()
43 })
44)
45

Built with git-ssb-web