Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(git): limit ls-remote output to heads/tags (#97)
Browse files Browse the repository at this point in the history
GitHub repositories can contain other types of refs, such as pull
requests, which can be fetched via `git-fetch` but not cloned via
`git clone -b`.

Fixes: npm/npm#16898
  • Loading branch information
mistydemeo authored and zkat committed Jun 5, 2017
1 parent 9816b18 commit c1e3dcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function revs (repo, opts) {
return BB.resolve(cached)
}
return pinflight(`ls-remote:${repo}`, () => {
return spawnGit(['ls-remote', repo], {
return spawnGit(['ls-remote', '-h', '-t', repo], {
env: gitEnv()
}, opts).then(child => {
let stdout = ''
Expand Down

0 comments on commit c1e3dcd

Please sign in to comment.