starship / starship

☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
https://starship.rs
ISC License
44.29k stars 1.92k forks source link

Git submodule branch shows the branch of the parent repository #4288

Closed sschleemilch closed 2 years ago

sschleemilch commented 2 years ago

Bug Report

When navigating into a submodule, the branch name is still taken from the parent repository.

Current Behavior

Branch name in submodule does not reflect the branch of the submodule

Expected Behavior

Branch name should always match the repository of your current working directory.

Additional context/Screenshots

image

To reproduce:

mkdir test && cd test
mkdir top && cd top
git init
touch x
git add x
git commit -m "init"
cd ..
mkdir sub && cd sub
git init
touch x
git add x
git commit -m "init"
cd ..
cd top
git submodule add ../sub
cd sub
git checkout -b something
git branch

Possible Solution

Environment

Relevant Shell Configuration

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=3000

# Changing "ls" to "exa"
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
alias la='exa -a --color=always --group-directories-first'  # all files and dirs
alias ll='exa -l --color=always --group-directories-first'  # long format
alias lt='exa -aT --color=always --group-directories-first' # tree listing
alias l.='exa -a | egrep "^\."'

eval "$(starship init zsh)"
eval "$(direnv hook zsh)"

source /home/q534774/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh

Starship Configuration

Default

davidkna commented 2 years ago

Please try updating to starship 1.10.2, it should have a fix for this.

sschleemilch commented 2 years ago

Please try updating to starship 1.10.2, it should have a fix for this.

Indeed upgrading to 1.10.2 fixed that one already, Thanks @davidkna