[PATCH] bash: display git prompt in case of merge conflict during rebase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since e5dd864a (completion: Better __git_ps1 support when not in
working directory, 2009-02-11) the git prompt becomes empty, if we hit
a merge conflict during a rebase.

e5dd864a added an if statement at the end of __git_ps1 to only display
anything in the prompt, if the branch name is not empty.  This caused
the empty prompt in the "merge conflict during rebase" case, because
in this case we display neither the branch name nor the abbreviated
SHA1, the ongoing rebase is identified.

This patch removes that check, so the git prompt is displayed even if
the branch name is empty.

Signed-off-by: SZEDER Gábor <szeder@xxxxxxxxxx>
---
 contrib/completion/git-completion.bash |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0c8bb53..6c78c94 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -152,12 +152,10 @@ __git_ps1 ()
 			fi
 		fi
 
-		if [ -n "$b" ]; then
-			if [ -n "${1-}" ]; then
-				printf "$1" "$c${b##refs/heads/}$w$i$r"
-			else
-				printf " (%s)" "$c${b##refs/heads/}$w$i$r"
-			fi
+		if [ -n "${1-}" ]; then
+			printf "$1" "$c${b##refs/heads/}$w$i$r"
+		else
+			printf " (%s)" "$c${b##refs/heads/}$w$i$r"
 		fi
 	fi
 }
-- 
1.6.3.1.189.g9321

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]