Skip to content

Commit e0d4a63

Browse files
committed
Merge branch 'vs/completion-with-set-u'
The command-line completion script (in contrib/) had a couple of references that would have given a warning under the "-u" (nounset) option. * vs/completion-with-set-u: completion: audit and guard $GIT_* against unset use
2 parents e654520 + c5c0548 commit e0d4a63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/completion/git-completion.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ __git_find_repo_path ()
7777
test -d "$__git_dir" &&
7878
__git_repo_path="$__git_dir"
7979
elif [ -n "${GIT_DIR-}" ]; then
80-
test -d "${GIT_DIR-}" &&
80+
test -d "$GIT_DIR" &&
8181
__git_repo_path="$GIT_DIR"
8282
elif [ -d .git ]; then
8383
__git_repo_path=.git
@@ -427,7 +427,7 @@ __gitcomp_builtin ()
427427

428428
if [ -z "$options" ]; then
429429
local completion_helper
430-
if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
430+
if [ "${GIT_COMPLETION_SHOW_ALL-}" = "1" ]; then
431431
completion_helper="--git-completion-helper-all"
432432
else
433433
completion_helper="--git-completion-helper"
@@ -1910,7 +1910,7 @@ _git_help ()
19101910
return
19111911
;;
19121912
esac
1913-
if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
1913+
if test -n "${GIT_TESTING_ALL_COMMAND_LIST-}"
19141914
then
19151915
__gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk"
19161916
else

0 commit comments

Comments
 (0)