mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
ignore subsequent lines of git status
as they may break the equality check by including changes to the repository
This commit is contained in:
parent
ef785d46b8
commit
0887040c87
1 changed files with 1 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ function git_prompt_info() {
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null)
|
ref=$(git symbolic-ref HEAD 2> /dev/null)
|
||||||
if [ -z $ref ]; then
|
if [ -z $ref ]; then
|
||||||
# check if in detached HEAD mode
|
# check if in detached HEAD mode
|
||||||
branch_name=$(git status -sb $(git_submodule_syntax) 2> /dev/null)
|
branch_name=$(git status -sb $(git_submodule_syntax) 2> /dev/null | head -n 1)
|
||||||
if [ "$branch_name" = "## HEAD (no branch)" ]; then
|
if [ "$branch_name" = "## HEAD (no branch)" ]; then
|
||||||
# set tag name if found
|
# set tag name if found
|
||||||
tag_name=$(git name-rev --name-only $(git --no-pager show --stat 2> /dev/null | head -n 1 | awk '{ print $2 }') 2> /dev/null)
|
tag_name=$(git name-rev --name-only $(git --no-pager show --stat 2> /dev/null | head -n 1 | awk '{ print $2 }') 2> /dev/null)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue