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: fallback to empty tree sha when no upstream set #687

Conversation

mrexox
Copy link
Member

@mrexox mrexox commented Apr 1, 2024

Closes #568
Closes #100

🔧 Summary

If there's no upstream set then git branch --remotes returns nothing. In this case we want to fallback to the empty tree SHA (which can be changed, so I decided not to hard-code it). This feels correct if we are pushing the first change. If not – then lefthook can't figure out what changes are already pushed, so applying the diff from the empty tree feels correct too.

Please, create an issue/discussion if you have troubles with this change.

@mrexox mrexox marked this pull request as ready for review April 1, 2024 07:27
@mrexox mrexox merged commit 7a1e5c0 into evilmartians:master Apr 2, 2024
17 of 19 checks passed
@mrexox mrexox deleted the fix/fallback-to-empty-tree-sha-when-no-upstream-set branch April 2, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant