Closed tvlieg closed 3 years ago
Hi, thanks for sending this, I wasn't aware of this setting.
Unfortunately, this change would break folks, as the global git setting will be returned if the local repository does not have it configured. As an example, this repo:
❯ omf cd git
git on master
❯ git config --get init.defaultBranch
main
That's a fair point; I've pushed a new commit that first checks for the existence of the configured defaultBranch, and only returns it if the current repo has that branch. Would that work?
Btw, I'm running into the issue in which I have a repo with both a master, but also a develop branch, in which I would like the default branch to be develop.
Thanks!
And thank you as well for thinking along :)
My first line of fish shell script, so please let me know if did anything off the hook!
The main goal of this PR is to use the return value for
git config --get init.defaultBranch
, if set, for function__git.default_branch.fish
.