Skip to content

Error: ENOENT, No such file or directory 'packed-refs' #1

Closed
@TooTallNate

Description

@TooTallNate

When attempting to use this lib on a "bare" git repo with a single commit pushed to it, I get this:

/home/nrajlich/wheat/lib/wheat.js:74
            if (err) { throw err; }
                       ^
Error: ENOENT, No such file or directory '/home/nrajlich/blog.git/packed-refs'
at node.js:221:9

When does the packed-refs file get created in Git? I worked around it by commenting out everything related to packed-refs in the Git.getHead method, and it seems to work fine, but obviously that's not the right way.

Any heads up? Or I guess node-git should be patched to check for the existence of that file before trying to read it, so that this error never happens :)

EDIT: I was further able to fix the error by simply running:

git pack-refs

and then the packed-refs file was created. I'm still in favor of checking for the existence of the file first. I'll try and get a patch ready if I have time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions