Skip to content

Fix get_default_branch function#2391

Merged
seefood merged 1 commit into
Bash-it:masterfrom
m3adow:fix/fix-get-default-branch-function
Jun 27, 2026
Merged

Fix get_default_branch function#2391
seefood merged 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
Contributor

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.

@seefood seefood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes! how was this ever added? great catch, thanks!

@seefood seefood merged commit 642d06b into Bash-it:master Jun 27, 2026
6 checks passed
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.

2 participants