From c1e3dcd2dae84d0ec8dde0a6792552025b4d262b Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Mon, 5 Jun 2017 07:34:34 -0700 Subject: [PATCH] fix(git): limit ls-remote output to heads/tags (#97) 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 --- lib/util/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/git.js b/lib/util/git.js index 6a82776..fc3d158 100644 --- a/lib/util/git.js +++ b/lib/util/git.js @@ -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 = ''