GithubHelp home page GithubHelp logo

Comments (3)

samcday avatar samcday commented on June 15, 2024

Hey there,

Good find, I'll investigate this shortly!

On Wed, Mar 30, 2011 at 2:54 PM, TooTallNate <
[email protected]>wrote:

You can see in the REPL output below, a proper Error object isn't being
created with the getEntry() call. Let me know if you need any more info!

repo = require('gitteh').openRepository('.git')
commit = repo.getCommit('6a355a4cd8f47bfc2d7c5ee951705b8baad5c711')
commit.getTree().getEntry('doesNotExist')
null // Expected an Error to be thrown here, not null returned...
commit.getTree().getEntry('doesNotExist', console.log)
{ stack: [Getter/Setter], arguments: undefined, type: undefined,
message: 'Couldn't get tree entry.' } // no stack, no error codes,
arguments and type are undefined...

Reply to this email directly or view it on GitHub:
#5

from node-gitteh.

samcday avatar samcday commented on June 15, 2024

Hey man,

Just looked into this, I'm throwing an error from the async codepath but only returning null from the synchronous code path. Oops...

Anyway look, I'm about to push out a new version which removes getEntry() altogether anyway. Instead the entries are just added in an array to the tree as a property, so you'll just go tree.entries[0] for example. I'm not going to bother adding the ability to get an entry by name, as searching for it using JS array mechanics is going to be a hell of a lot faster than calling into the native library to do it for you.

I'll be pushing these changes out fairly soon, I'll keep you posted!

from node-gitteh.

samcday avatar samcday commented on June 15, 2024

Hey,

I released 0.1.0 tonight, which removes the need for Tree.getEntry completely. Instead you can just manipulate tree.entries array.

Closing this issue now

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.