starship/tests/testsuite
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
..
aws.rs fix: Fix latest clippy suggestions (#1136) 2020-04-24 12:37:13 +02:00
character.rs Support vicmd_symbol in fish-shell (#254) 2019-08-31 00:59:18 -07:00
cmd_duration.rs fix: Fix incorrect prefix usage in cmd_duration module (#832) 2020-01-18 01:15:08 -06:00
common.rs fix: possible fix for Intermittent Test Failures in GH Actions (#987) 2020-03-15 12:12:25 -05:00
conda.rs fix: Do not depend on user's config in conda tests (#1098) 2020-04-13 21:23:49 +02:00
configuration.rs fix: Lazy load git repo and only run module if not disabled (#306) 2019-09-09 19:14:38 -04:00
directory.rs build(deps): bump path-slash from 0.1.1 to 0.1.2 (#1377) 2020-06-22 18:41:05 -04:00
dotnet.rs feat(dotnet): adds additional files to detect .net projects (#1303) 2020-06-21 10:22:20 +02:00
env_var.rs feat: Add Environment Variable module (#409) 2019-09-26 17:30:58 +09:00
git_branch.rs feat: git branch: read from HEAD on newly initialized repo (#1336) 2020-07-05 13:22:14 -04:00
git_commit.rs test: Add null tests to modules that don't have them (#1104) 2020-04-15 09:55:32 +02:00
git_state.rs fix: Fix latest clippy suggestions (#1136) 2020-04-24 12:37:13 +02:00
git_status.rs fix: Fix latest clippy suggestions (#1136) 2020-04-24 12:37:13 +02:00
hg_branch.rs fix: Fix latest clippy suggestions (#1136) 2020-04-24 12:37:13 +02:00
hostname.rs feat: Add configuration for hostname truncation (#485) 2019-10-15 01:22:25 +09:00
jobs.rs fix: Lazy load git repo and only run module if not disabled (#306) 2019-09-09 19:14:38 -04:00
line_break.rs Refactor integration tests (#71) 2019-06-06 13:18:00 +01:00
main.rs feat: add singularity module (#932) 2020-02-26 11:18:19 -05:00
modules.rs fix: Change panicking on unknown module to error print and support module listing flag (#197) 2019-08-20 00:42:25 -04:00
nix_shell.rs feat(nix_shell): add symbol to nix-shell module (#1058) 2020-04-07 18:35:18 +02:00
python.rs feat(python): Add option to change the python binary (#1297) 2020-06-14 11:27:10 +02:00
singularity.rs test: Add null tests to modules that don't have them (#1104) 2020-04-15 09:55:32 +02:00
terraform.rs fix: Fix latest clippy suggestions (#1136) 2020-04-24 12:37:13 +02:00
time.rs revert: chore: Remove logic for the disabled option from modul… (#489) 2019-10-05 19:03:48 +09:00
username.rs feat: Add option to always show the username module (#408) 2019-09-22 15:32:11 -05:00