Skip to content

Fix get_default_branch function#2391

Open
m3adow wants to merge 1 commit into
Bash-it:masterfrom
m3adow:fix/fix-get-default-branch-function
Open

Fix get_default_branch function#2391
m3adow wants to merge 1 commit into
Bash-it:masterfrom
m3adow:fix/fix-get-default-branch-function

Conversation

@m3adow

@m3adow m3adow commented Jun 11, 2026

Copy link
Copy Markdown

Description

This fixes the get_default_branch_function in the git aliases not working, resulting in several other git aliases not working either.

Motivation and Context

See above.

How Has This Been Tested?

Testing in the bash_it repo:

before:

$ get_default_branch 
Command 'master' not found, did you mean:
  command 'easter' from snap easter (1.2.1)
  command 'master1' from deb pvm-examples (3.4.6-3.2)
See 'snap info <snapname>' for additional versions.
$ gswm
Command 'master' not found, did you mean:
  command 'easter' from snap easter (1.2.1)
  command 'master1' from deb pvm-examples (3.4.6-3.2)
See 'snap info <snapname>' for additional versions.
fatal: missing branch or commit argument

after:

$ get_default_branch 
master
$ gswm
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

Types of changes

  • 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:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • 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.

It's literally one line changed, so I don't think any tests are needed. I can write some for the function if you want to though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant