Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TooTallNate opened this issue Jul 2, 2010 · 5 comments
Closed

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

TooTallNate opened this issue Jul 2, 2010 · 5 comments

Comments

@TooTallNate
Copy link
Contributor

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.

@creationix
Copy link
Owner

Is this still an issue? I want the code to always get the correct HEAD sha no matter what valid state the git repo is in.

@TooTallNate
Copy link
Contributor Author

Ya it's pretty much fixed. Like I said, I just had to run git pack-refs to make the packed-refs file be created. After that everything worked fine.

I guess if somebody else tried this module on a bare repo without that file in it the same error would happen, which is why I was suggesting to check the existence of the file first. The error is gone for me though...

@XULRunner42
Copy link

How do I ensure that my remote repository uses packed-refs?

I am trying to deploy wheat on nodester platform... the main nodester remote at least does not do pack-refs, and is in a locked-down chroot with no "git" binary or even the correct libraries to run ls.

So, I've verified that I have description, refs, hooks, config, index, HEAD, logs, FETCH_HEAD, ORIG_HEAD, info, objects, branches, and no packed-refs... I'm going to see if they might consider running pack-refs. If no, is there something else we could use?

@creationix
Copy link
Owner

@XULRunner42, if you don't have a git binary I don't think this is going to work at all. This library uses the git binary for everything except for the quick check to find the latest hash.

@XULRunner42
Copy link

Ok thanks! I am working with nodester guys to redeploy their hosted
platform on my own hardware, once I'm there, it should be no trouble adding
the git binary to the chroot. Thanks for the advice!
On Feb 20, 2012 10:27 AM, "Tim Caswell" <
[email protected]>
wrote:

@XULRunner42, if you don't have a git binary, I don't think this is
going to work at all. This library uses the git binary for everything
except for the quick check to find the latest hash.


Reply to this email directly or view it on GitHub:
#1 (comment)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants