ZSH: prompt: show branch on older versions of git
This commit is contained in:
parent
5c159344fc
commit
d92ac70946
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ function prompt_project() {
|
||||||
prompt_git(){
|
prompt_git(){
|
||||||
local repoTopLevel="$(command git rev-parse --show-toplevel 2> /dev/null)"
|
local repoTopLevel="$(command git rev-parse --show-toplevel 2> /dev/null)"
|
||||||
if [ -n "$repoTopLevel" ]; then
|
if [ -n "$repoTopLevel" ]; then
|
||||||
local branch="$(git branch --show-current 2> /dev/null)"
|
local branch="$(git branch --show-current 2> /dev/null || git rev-parse --abbrev-ref HEAD)"
|
||||||
local tag="$(git describe --tags --exact-match HEAD 2> /dev/null)"
|
local tag="$(git describe --tags --exact-match HEAD 2> /dev/null)"
|
||||||
local color="green"
|
local color="green"
|
||||||
local ret=""
|
local ret=""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue