git ssb

0+

cel / pull-git-remote-helper



Commit b634a730e0a867de83e309323cb2c57c2714d0da

Make hashes in test more explicit

Charles Lehner committed on 2/8/2016, 4:37:24 AM
Parent: 17c29f2cc34026a1af2ec44ea384e15716514a8f

Files changed

test/run.jschanged
test/run.jsView
@@ -75,19 +75,22 @@
7575 tape('make a commit and push', function (t) {
7676 var commitMessage = 'Initial commit'
7777 var fileName = 'blah.txt'
7878 var fileContents = 'i am a file'
79- var fileHash = new Buffer(20)
80- fileHash.hexWrite('68bd10497ea68e91fa85024d0a0b2fe54e212914')
79+ var fileHash = '68bd10497ea68e91fa85024d0a0b2fe54e212914'
80+ var treeHash = '75c54aa020772a916853987a03bff7079463a861'
81+ var commitHash = 'edb5b50e8019797925820007d318870f8c346726'
82+ var fileHashBuf = new Buffer(20)
83+ fileHashBuf.hexWrite(fileHash)
8184
8285 var objects = t.items(t.deepEquals, [
8386 [{
8487 type: 'commit',
85- data: 'tree 75c54aa020772a916853987a03bff7079463a861\nauthor ' + userStr + ' 1000000000 -0500\ncommitter ' + userStr + ' 1000000000 -0500\n\n' + commitMessage + '\n'
88+ data: 'tree ' + treeHash + '\nauthor ' + userStr + ' 1000000000 -0500\ncommitter ' + userStr + ' 1000000000 -0500\n\n' + commitMessage + '\n'
8689 }, 'got the commit'],
8790 [{
8891 type: 'tree',
89- data: '100644 ' + fileName + '\0' + fileHash.toString('ascii')
92+ data: '100644 ' + fileName + '\0' + fileHashBuf.toString('ascii')
9093 }, 'got the tree'],
9194 [{
9295 type: 'blob', data: fileContents
9396 }, 'got the blob']
@@ -95,9 +98,9 @@
9598
9699 var refs = t.items(t.deepEquals, [
97100 [{
98101 name: 'refs/heads/master',
99- new: 'edb5b50e8019797925820007d318870f8c346726',
102+ new: commitHash,
100103 old: null
101104 }, 'got the ref']
102105 ])
103106

Built with git-ssb-web