Skip to content

Commit 304d8b6

Browse files
committed
Merge branch 'as/maint-completion-set-u-fix'
* as/maint-completion-set-u-fix: bash-completion: Fix __git_ps1 to work with "set -u"
2 parents 8b3120d + 6c44b64 commit 304d8b6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

contrib/completion/git-completion.bash

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ __git_ps1 ()
8484
{
8585
local g="$(__gitdir)"
8686
if [ -n "$g" ]; then
87-
local r
88-
local b
87+
local r=""
88+
local b=""
8989
if [ -f "$g/rebase-merge/interactive" ]; then
9090
r="|REBASE-i"
9191
b="$(cat "$g/rebase-merge/head-name")"
@@ -127,11 +127,11 @@ __git_ps1 ()
127127
}
128128
fi
129129

130-
local w
131-
local i
132-
local s
133-
local u
134-
local c
130+
local w=""
131+
local i=""
132+
local s=""
133+
local u=""
134+
local c=""
135135

136136
if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
137137
if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then

0 commit comments

Comments
 (0)