Git Product home page Git Product logo

Comments (5)

mildsunrise avatar mildsunrise commented on June 11, 2024

A reference points to a commit (or another reference).
It can't be a commit. getReference() returns references, not commits.

There are two types of references:

  • Tags are meant to not change. They're found under refs/tags
  • Branches are meant to always point to the latest commit. They're found under refs/heads.

There's also a special reference HEAD, that points to what you last checked out.
If you're working on branch master, HEAD will point to refs/heads/master, which will point to some commit.

So the title of the issue should be: Distinguish between tags and branches.
You found another bug: resolve() fails on a tag.

from node-gitteh.

blalor avatar blalor commented on June 11, 2024

Duly noted and updated. :-)

from node-gitteh.

mildsunrise avatar mildsunrise commented on June 11, 2024

@balor, just by curiosity, can you post the error when you call resolve()?
Also, are you installing by NPM or cloning the source?

from node-gitteh.

blalor avatar blalor commented on June 11, 2024

@jmendeth: here's a gist that will reproduce the issue: https://gist.github.com/6725caa86c012c4c6d64

from node-gitteh.

samcday avatar samcday commented on June 11, 2024

@blalor While probably not helpful to you now, I'll note that gitteh 0.17.x is a refactor and approaches refs a bit differently.

gitteh.References don't actually have a resolve() method in their latest incarnation (this can manually be achieved right now by recursively resolving the reference target until direct is true), however they will eventually. The difference now is when you use gitteh.object to resolve the reference target to a gitteh Object, there is a property called type that will determine whether you're looking at a commit, or a heavyweight Tag object.

from node-gitteh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.