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

fix: Make info dir when it is absent #414

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

sato11
Copy link
Contributor

@sato11 sato11 commented Jan 7, 2023

Closes #413

⚡ Summary

The presence of .git/info directory has been taken for granted, but it can be actually nonexistent. This results in an unhandled enoent. I've changed it so the presence of it is made sure when initializing Repository.

The point I believe is that .git/info could be absent. On the other hand I'm not sure if we can take for granted that .git/hooks always exists, or the same mishap can occur. At least in my environment the hooks dir is provisioned automatically (where the info is not) but I haven't been able to reason about it documentationally.

This does fix my problems but since I'm not really sure what the scope of fix should be, any feedback is welcome. Thanks in advance!

☑️ Checklist

  • Check locally
  • Add tests

@mrexox
Copy link
Member

mrexox commented Jan 9, 2023

Hey! Thank you for the PR! I think this is really helpful! I never thought that Git can omit creating info directory. I'll release the fix soon today or tomorrow

@mrexox mrexox changed the title Make info dir when it is absent fix: Make info dir when it is absent Jan 9, 2023
@mrexox mrexox merged commit 82f8a08 into evilmartians:master Jan 9, 2023
@sato11 sato11 deleted the mkdir-info-when-it-is-absent branch January 10, 2023 03:08
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

Successfully merging this pull request may close these issues.

lefthook install fails when .git/info dir is missing
2 participants