Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Repository::checkoutReference doesn't work with remote or tag references #50

Open
olmokramer opened this issue Jul 30, 2015 · 0 comments

Comments

@olmokramer
Copy link

Redirected here from atom/atom#7973

The following works just fine

repository.checkoutReference('refs/heads/branch');

But when I have a remote branch named remote-branch on the origin remote and I try

repository.checkoutReference('refs/remotes/origin/remote-branch');

It fails to check out the remote branch. The same is true for tags. Apparently, it will only check out local branches:

Repository::checkoutReference = (branch, create)->
  if branch.indexOf('refs/heads/') isnt 0
    branch = "refs/heads/#{branch}"

  @checkoutRef(branch, create)

What's the reason for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant