Skip to content

Repository.setHeadDetached fails with an internal assertion #701

@rhuss

Description

@rhuss

When using this following promise

function checkOutCommit(repo,commit) {
  console.log('Changing HEAD to ', commit.id());
  repo.setHeadDetached(commit.id(), repo.defaultSignature, "Checkout: HEAD " + commit.id());
  console.log('Checking out HEAD');
  return Git.Checkout.head(repo, {
    checkoutStrategy: Git.Checkout.STRATEGY.FORCE
  });
}

I get the following output

Changing HEAD to  [Oid d1ef6ef21f21748b611e86514c4dfff07e0d8ff7]
Assertion failed: (handle->InternalFieldCount() > 0), function Unwrap, file /Users/johnh/.node-gyp/0.12.4/src/node_object_wrap.h, line 50.

While we are on it, was is the canonical way to check out on a particular tag in a detached state ? I tried the suggestions found on gitter and here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions