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

Removing a ref after lefthook install fails to fetch from the main branch #364

Open
mrexox opened this issue Nov 15, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@mrexox
Copy link
Member

mrexox commented Nov 15, 2022

Summary

When you remove a ref option from remote configuration, and you already had lefthook install-ed, the remote syncing fails.

Steps to reproduce

remote:
  git_url: https://github.com/evilmartians/lefthook
  ref: v1.1.1
  config: examples/complete/lefthook.yml
$ lefthook install
SYNCING
SERVED HOOKS: commit-msg, pre-commit, pre-push
$ git -C .git/info/lefthook-remotes/lefthook/ log --oneline
55f4381 (grafted, HEAD, tag: v1.1.1) 1.1.1: Quote path to script
remote:
  git_url: https://github.com/evilmartians/lefthook
  config: examples/complete/lefthook.yml # assumed to fetch from master branch 
$ lefthook install
SYNCING
SERVED HOOKS: commit-msg, pre-commit, pre-push
$ git -C .git/info/lefthook-remotes/lefthook/ log --oneline
55f4381 (grafted, HEAD, tag: v1.1.1) 1.1.1: Quote path to script # (!) must be master branch

Expected results

Expected to checkout to the main branch of the repository. May be master or main branch at least.

Possible Solution

Provide a default value for the ref.

@mrexox mrexox added the bug Something isn't working label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant