Skip to content

Commit

Permalink
fix(git): limit ls-remote output to heads/tags
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 committed Jun 2, 2017
1 parent 42a714c commit 92205a1
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 92205a1

Please sign in to comment.