
Product
Introducing Custom Pull Request Alert Comment Headers
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
abstract-pull-git-repo
Advanced tools
git repo interface using pull-streams
git objects are represented by an object with the following properties:
type
: the type of the object, one of ["tag", "commit", "tree", "blob"]
length
: the size in bytes of the object
read
: read(abort, next(end, buf))
readable stream for an object to add
repo.refs([prefix])
: read(abort, next(end, {name, hash}))
Get the repo's refs.
prefix
: optional prefix for filtering refs, e.g. 'refs/heads'
read
: readable stream of ref infoname
: the name of the ref, e.g. 'refs/heads/master'
hash
: git sha1 hash of the git object that the ref points torepo.hasObject(hash, cb(err, bool))
Get whether the repo contains the given git object
hash
: git sha1 hash of the object to check the presence oferr
: error doing the lookup, if anybool
: truthy if the repo contains the given objectrepo.getObject(hash, cb(err, object))
Get a git object from the repo
hash
: sha1 hash of the git object to getobject
: the git object, or falsy if it is not presentrepo.update(refs, objects, cb(err))
Update a repo by adding objects to it and/or updating its refs. Can only be done by the feed owner.
refs
: read(abort, next(end, {name, old, new}))
readable stream of ref updates
name
: the name of the ref to updateold
: old value (sha1) of the ref. falsy if the ref is to be creatednew
: new value (sha1) of the ref. falsy to delete the refobjects
: read(abort, next(end, object))
readable stream of objects to add to the repo
cb
: function called after all objects and refs have been read.
err
: error if updating the refs or reading the objects failed.
If truthy, the repo will not have been updatedUse this repo's test suite to test your own git repo implementation:
tests.repo(test, repo)
Test that an empty repo can be pushed to and updated
test
: tape-compatible test objectrepo
: abstract-pull-git-repo
-compatible repo objectvar test = require('tape')
var tests = require('abstract-pull-git-repo/tests')
var Repo = require('your-custom-git-repo-implementation')
tests.repo(test, new Repo)
tests.repos(test, repoA, getRepoB(cb(err, repoB))
Test that updates pushed to one repo are visible on the other repo
test
: tape-compatible test objectrepoA
: repo to updaterepoB
: repo to retrieve updates fromgetRepoB
: function to get repo to retrieve updates from. May be called more
than once.err
: error getting a repo, if anyvar SyncedRepo = require('your-custom-synced-git-repo')
var repo = new SyncedRepo()
tests.repos(test, repo, function (cb) {
cb(null, new SyncedRepo(repo.id))
})
See also keyword pull-git-repo
on npm
Copyright (c) 2016 Charles Lehner
Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
FAQs
abstract git repo interface using pull streams
The npm package abstract-pull-git-repo receives a total of 0 weekly downloads. As such, abstract-pull-git-repo popularity was classified as not popular.
We found that abstract-pull-git-repo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.