Skip to content

Commit

Permalink
fix: fix git checkout fallback, make ls-remote filtering stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 1, 2020
1 parent e363b14 commit 1e37f92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ Git.prototype.fetch = function(remote) {
* @return {Promise} A promise.
*/
Git.prototype.checkout = function(remote, branch) {
const treeish = remote + '/' + branch;
return this.exec('ls-remote', '--exit-code', '.', treeish).then(
const treeish = 'remotes/' + remote + '/' + branch;
return this.exec('ls-remote', '--refs', '--exit-code', '.', treeish).then(
() => {
// branch exists on remote, hard reset
return this.exec('checkout', branch)
Expand Down

0 comments on commit 1e37f92

Please sign in to comment.