bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

Add heuristic for finding default remote name

Open hyperupcall opened this issue 4 months ago • 0 comments

Description, Motivation and Context

Fixes #2317

Implementation:

  • If HEAD is not detached, it infers the remote name by the current branch
  • If HEAD is detached, then it infers the remote name by parsing git 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.txt and formatted it using lint_clean_files.sh.
  • [ ] I have added tests to cover my changes, and all the new and existing tests pass.

hyperupcall avatar Jun 02 '25 13:06 hyperupcall