git ssb

0+

cel / pull-git-remote-helper



Tree: b57e8b80419ea2fb7cf7d3b5281d371a2b3976c0

Files: b57e8b80419ea2fb7cf7d3b5281d371a2b3976c0 / test / repo.js

892 bytesRaw
1function hexToStr(str) {
2 var buf = new Buffer(str.length / 2)
3 buf.hexWrite(str)
4 return buf.toString('ascii')
5}
6
7var date = '1000000000 -0500'
8
9var user = {
10 name: 'test',
11 email: 'test@localhost'
12}
13user.str = user.name + ' <' + user.email + '>'
14
15var file = {
16 name: 'blah.txt',
17 data: 'i am a file',
18 hash: '68bd10497ea68e91fa85024d0a0b2fe54e212914'
19}
20
21var tree = {
22 hash: '75c54aa020772a916853987a03bff7079463a861',
23 data: '100644 ' + file.name + '\0' + hexToStr(file.hash)
24}
25
26var commitMessage = 'Initial commit'
27var commit = {
28 hash: 'edb5b50e8019797925820007d318870f8c346726',
29 data: ['tree ' + tree.hash,
30 'author ' + user.str + ' ' + date,
31 'committer ' + user.str + ' ' + date,
32 '', commitMessage, ''
33 ].join('\n')
34}
35
36exports.date = date
37exports.user = user
38exports.file = file
39exports.tree = tree
40exports.commitMessage = commitMessage
41exports.commit = commit
42

Built with git-ssb-web