pull-git-repo
Advanced tools
Comparing version 0.2.3 to 0.2.4
17
index.js
@@ -172,5 +172,2 @@ var buffered = require('pull-buffered') | ||
if (name.indexOf('/') === -1) | ||
name = 'refs/heads/' + name | ||
var readRef = this.refs() | ||
@@ -180,8 +177,10 @@ readRef(null, function next(end, ref) { | ||
cb(new NotFoundError('Ref \'' + name + '\' not found')) | ||
else if (ref.name !== name) | ||
readRef(null, next) | ||
else | ||
else if (ref.name === name | ||
|| ref.name === 'refs/heads/' + name | ||
|| ref.name === 'refs/tags/' + name) | ||
readRef(true, function (err) { | ||
cb(err === true ? null : err, ref.hash) | ||
}) | ||
else | ||
readRef(null, next) | ||
}) | ||
@@ -269,2 +268,7 @@ } | ||
}) | ||
case 'tag': | ||
return readCommitOrTagProperty(object, 'object', function (err, hash) { | ||
if (err) return cb(err) | ||
self.getRef(hash, gotRef) | ||
}) | ||
default: | ||
@@ -455,3 +459,2 @@ return cb(new Error('Expected tree, got ' + object.type)) | ||
if (err) return cb(err) | ||
if (obj && obj.length > 100000) return cb(new Error('Bad object')) | ||
pull(obj.read, pull.collect(function (err, objBufs) { | ||
@@ -458,0 +461,0 @@ if (err) return cb(err) |
{ | ||
"name": "pull-git-repo", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "utility methods for git repos using pull streams", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -58,3 +58,4 @@ # pull-git-repo | ||
- `name`: name of a ref pointing to the object, or SHA1 of the object | ||
- `name`: name of a branch, tag, or ref pointing to the object, | ||
or SHA1 of the object | ||
@@ -72,4 +73,4 @@ #### `repo.getCommit(rev, cb(err, object, id))` | ||
Get a tree object. If `rev` refers to a commit, get the tree that the | ||
commit refers to. | ||
Get a tree object. If `rev` refers to a commit or tag, get the tree that it | ||
points to. | ||
@@ -76,0 +77,0 @@ #### `repo.getCommitParsed(rev, cb(err, commit))` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19931
545
140