bash-it
bash-it copied to clipboard
Add heuristic for finding default remote name
Description, Motivation and Context
Fixes #2317
Implementation:
- If
HEADis not detached, it infers the remote name by the current branch - If
HEADis detached, then it infers the remote name by parsinggit remote -v, but only if every entry has the same remote name
I've made similar PRs in other projects, so this does work in general.
How Has This Been Tested?
Manual testing
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [x] If my change requires a change to the documentation, I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [x] If I have added a new file, I also added it to
clean_files.txtand formatted it usinglint_clean_files.sh. - [ ] I have added tests to cover my changes, and all the new and existing tests pass.