Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix early wrapping of the command line when using git-prompt.sh and in a git repository #1691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contrib/completion/git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ __git_ps1_colorize_gitstring ()
else
# Using \001 and \002 around colors is necessary to prevent
# issues with command line editing/browsing/completion!
local c_red=$'\001\e[31m\002'
local c_green=$'\001\e[32m\002'
local c_lblue=$'\001\e[1;34m\002'
local c_clear=$'\001\e[0m\002'
local c_red=$'\\001\e[31m\\002'
local c_green=$'\\001\e[32m\\002'
local c_lblue=$'\\001\e[1;34m\\002'
local c_clear=$'\\001\e[0m\\002'
fi
local bad_color=$c_red
local ok_color=$c_green
Expand Down
8 changes: 4 additions & 4 deletions t/t9903-bash-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"

actual="$TRASH_DIRECTORY/actual"
c_red='\001\e[31m\002'
c_green='\001\e[32m\002'
c_lblue='\001\e[1;34m\002'
c_clear='\001\e[0m\002'
c_red='\\001\e[31m\\002'
c_green='\\001\e[32m\\002'
c_lblue='\\001\e[1;34m\\002'
c_clear='\\001\e[0m\\002'

test_expect_success 'setup for prompt tests' '
git init otherrepo &&
Expand Down
Loading