Files: 16cb3742dd9d961d752709c70a7d7e0d0139c0f8 / test / git-remote-full.js
842 bytesRaw
1 | |
2 | |
3 | var toPull = require('stream-to-pull-stream') |
4 | var pull = require('pull-stream') |
5 | |
6 | process.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 | |
13 | var objects = {} |
14 | |
15 | var ref = {value: 'edb5b50e8019797925820007d318870f8c346726'} |
16 | var refs = { |
17 | 'refs/heads/master': ref, |
18 | HEAD: ref |
19 | } |
20 | |
21 | function 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 | |
33 | pull( |
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