2.0.0 • Published 9 years ago
pull-git-remote-helper v2.0.0
pull-git-remote-helper
Make a git remote helper that integrates with git's internal objects.
Example
#!/usr/bin/env node
var toPull = require('stream-to-pull-stream')
var pull = require('pull-stream')
var gitRemoteHelper = require('.')
var repo = {
refs: pull.empty,
hasObject: function (hash, cb) { cb(null, false) },
getObject: function (hash, cb) { cb(null, null) },
update: function (readUpdates, readObjects) {
pull(
readUpdates,
pull.drain(function (update) {
console.error('Updating ' + update.name + ' to ' + update.new)
})
)
readObjects(null, function next(end, object) {
if (end === true) return
if (end) throw end
pull(
object.read,
pull.collect(function (err, bufs) {
if (err) throw err
var buf = Buffer.concat(bufs, object.length)
console.error('Got object', object, buf)
readObjects(null, next)
})
)
})
}
}
pull(
toPull(process.stdin),
gitRemoteHelper(repo),
toPull(process.stdout)
)API
gitRemoteHelper(repo)
Create a through-stream for the stdio of a git-remote-helper
repo: an abstract-pull-git-repo-compliant git repo object.
TODO
- Handle shallow and unshallow fetch
License
Fair License
2.0.0
9 years ago
1.4.4
9 years ago
1.4.3
9 years ago
1.4.2
9 years ago
1.4.1
9 years ago
1.4.0
9 years ago
1.3.5
10 years ago
1.3.4
10 years ago
1.3.3
10 years ago
1.3.2
10 years ago
1.3.1
10 years ago
1.3.0
10 years ago
1.2.0
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago