1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-05 04:47:58 +00:00
starship/tests
Walther Chen 489838e6a2
feat: git branch: read from HEAD on newly initialized repo (#1336)
* Git branch: read from HEAD on newly init repo

On a newly initialized git repo, there are no branches created until a
commit is made. Previously, starship handled this by having a default
branch "master" for when branch `head` could not be read.

However, if a user wants to set a different default branch name, that
name won't appear on starship until a commit is made to the branch.

If git2 provides a way to read the default branch name, we can use that,
but at the moment it's not obvious how.

For the moment, we can directly read `.git/HEAD`, which contains the
name of the default branch head reference. This commit implements this
strategy.

Closes #1327

* update git_branch test from unborn master to unborn default

* cargo fmt
2020-07-05 13:22:14 -04:00
..
fixtures feat: Add the hg_branch module (#569) 2019-12-02 17:37:18 -05:00
testsuite feat: git branch: read from HEAD on newly initialized repo (#1336) 2020-07-05 13:22:14 -04:00