Skip to content

Conversation

@jawshooah
Copy link
Collaborator

Otherwise you get fatal: Not a valid object name HEAD since git ls-tree requires an existing rev.

This PR also exposes HookContext::PreCommit#initial_commit? as a public method with a corresponding delegator to make it accessible to hooks.

@jawshooah
Copy link
Collaborator Author

Looks like initial_commit? must also be exposed by the RunAll hook context for this to work. @sds, is it worth the code duplication to add that, or should we just use Overcommit::GitRepo.initial_commit? in pre-commit hooks?

@sds
Copy link
Owner

sds commented Jun 3, 2015

Given there are very few built-in hooks that use inital_commit?, your suggestion of having them call Overcommit::GitRepo.initial_commit? seems reasonable here.

@sds sds added the bug label Jun 3, 2015
Otherwise you get 'fatal: Not a valid object name HEAD' since
`git ls-tree` requires an existing rev.
@jawshooah
Copy link
Collaborator Author

Agreed, pushed the fix. Should be good to go.

@sds
Copy link
Owner

sds commented Jun 3, 2015

Merged in d898ff5. Thanks for the fix!

@sds sds closed this Jun 3, 2015
@jawshooah jawshooah deleted the case-conflicts-initial-commit branch June 3, 2015 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants