Skip to content

Commit

Permalink
completion: fix PS1 display during an AM on detached HEAD
Browse files Browse the repository at this point in the history
This is a companion patch to previous 8763dbb (completion: fix PS1 display
during a merge on detached HEAD, 2009-05-16).  While rebasing or running am
on a detached HEAD, the code failed to set $b (branch description) that
enables the whole status display business.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 27, 2009
1 parent 94ad243 commit d7107ca
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,24 @@ __git_ps1 ()
if [ -n "$g" ]; then
local r
local b
if [ -d "$g/rebase-apply" ]; then
if [ -f "$g/rebase-apply/rebasing" ]; then
r="|REBASE"
elif [ -f "$g/rebase-apply/applying" ]; then
r="|AM"
else
r="|AM/REBASE"
fi
b="$(git symbolic-ref HEAD 2>/dev/null)"
elif [ -f "$g/rebase-merge/interactive" ]; then
if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i"
b="$(cat "$g/rebase-merge/head-name")"
elif [ -d "$g/rebase-merge" ]; then
r="|REBASE-m"
b="$(cat "$g/rebase-merge/head-name")"
else
if [ -f "$g/MERGE_HEAD" ]; then
if [ -d "$g/rebase-apply" ]; then
if [ -f "$g/rebase-apply/rebasing" ]; then
r="|REBASE"
elif [ -f "$g/rebase-apply/applying" ]; then
r="|AM"
else
r="|AM/REBASE"
fi
elif [ -f "$g/MERGE_HEAD" ]; then
r="|MERGING"
fi
if [ -f "$g/BISECT_LOG" ]; then
elif [ -f "$g/BISECT_LOG" ]; then
r="|BISECTING"
fi

Expand Down

0 comments on commit d7107ca

Please sign in to comment.