1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-10-01 14:39:12 +00:00
starship/src
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
..
configs feat(python): Add option to change the python binary (#1297) 2020-06-14 11:27:10 +02:00
formatter fix: Fix variable styles in string formatter (#1069) 2020-04-10 18:23:20 +02:00
init fix(bash): last command status and command duration (#1185) 2020-06-10 18:53:56 +02:00
modules fix: manage sandboxed version of OCaml (#1433) 2020-07-05 13:20:11 -04:00
bug_report.rs Replace dirs with dirs-next dependency (#1361) 2020-06-20 12:59:35 -05:00
config.rs refactor(config): Add additional logging to debug config issues (#1390) 2020-06-24 16:11:05 -04:00
configure.rs Replace dirs with dirs-next dependency (#1361) 2020-06-20 12:59:35 -05:00
context.rs feat: git branch: read from HEAD on newly initialized repo (#1336) 2020-07-05 13:22:14 -04:00
lib.rs improvement: add parser for format strings (#1021) 2020-04-06 13:16:18 -04:00
main.rs fix: replacing default RUST_LOG environement variable with starship specific one, to prevent interlacing (#1280) 2020-06-14 20:22:34 +02:00
module.rs feat(nim): Add Nim module (#1189) 2020-06-09 19:14:47 +02:00
print.rs refactor: latest suggestions from Clippy 2020-06-05 23:20:11 -04:00
segment.rs fix: Fix variable styles in string formatter (#1069) 2020-04-10 18:23:20 +02:00
utils.rs fix: manage sandboxed version of OCaml (#1433) 2020-07-05 13:20:11 -04:00