-
Notifications
You must be signed in to change notification settings - Fork 2
/
push.js
42 lines (29 loc) · 850 Bytes
/
push.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var test = require('tap').test
var Gitstream = require('../../git-stream')
var git = new Gitstream()
module.exports = {
"A repo should receive a push from another repo": function(test) {
test.plan(1)
//
// get a repository from the fixtures directory and
// send it to the origin (on the same machine).
//
var repo = git.createRepo({ path: './fixtures/repos/a' })
repo.remote.add({
name: 'origin',
branch: 'master',
host: '127.0.0.1',
port: '8000',
path: '/fixtures/a/b'
})
repo.push('origin')
net.createServer(function(socket) {
var repo = git.createRepo({ path: '/fixtures/a/b' })
var writer = fstream.Writer({ path: repo.path })
socket
.pipe(repo)
.pipe(repo.checkout('master'))
.pipe(writer)
}).listen(8000)
})
}