Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-git-repo

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-git-repo - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

42

index.js

@@ -119,3 +119,3 @@ var buffered = require('pull-buffered')

if (!name)
return cb(new Error('Invalid name'))
return cb(new Error('Invalid name \'' + name + '\''))

@@ -250,3 +250,3 @@ if (this.isCommitHash(name))

id: hash.toString('hex'),
mode: s[0],
mode: parseInt(s[0], 8),
name: s[1]

@@ -261,24 +261,26 @@ })

var readTree = this.readTree(rev)
if (path.length === 0 || path === '/')
return readTree
var self = this
path = (typeof path == 'string') ? path.split(/\/+/) : path.slice()
return readNext(function next(cb) {
if (path.length === 0) {
// this is the directory the caller wants to read
return cb(null, readTree)
}
var self = this
return readNext(function (cb) {
readTree(null, function next(err, file) {
if (err) return cb(err)
if (file.name !== path[0])
return readTree(null, next)
if (file.mode !== '040000')
return cb(new Error('Bad path'))
// cancel reading current tree
readTree(true, function (err) {
// find the next file in the path
pull(
readTree,
pull.filter(function (file) {
return file.name === path[0] && file.mode == 040000
}),
pull.take(1),
pull.collect(function (err, files) {
if (err) return cb(err)
var file = files[0]
if (!file) return cb(new Error('File \'' + path[0] + '\' not found'))
path.shift()
// start reading tree of found file
readTree = self.readTree(file.hash)
readTree = self.readTree(file.id)
next(cb)
})
})
)
})

@@ -308,3 +310,3 @@ }

read: object.read,
mode: file.mode
mode: parseInt(file.mode, 8)
})

@@ -311,0 +313,0 @@ })

{
"name": "pull-git-repo",
"version": "0.2.0",
"version": "0.2.1",
"description": "utility methods for git repos using pull streams",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc