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

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

@olmokramer

Description

@olmokramer

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions