1
0
mirror of https://github.com/git/git.git synced 2024-10-21 05:48:38 +02:00
git/contrib/completion
Ted Pavlic 25a31f8140 bash-completion: Support running when set -u is enabled
Under "set -u" semantics, it is an error to access undefined variables.
Some user environments may enable this setting in the interactive shell.

In any context where the completion functions access an undefined
variable, accessing a default empty string (aka "${1-}" instead of "$1")
is a reasonable way to code the function, as it silences the undefined
variable error while still supplying an empty string.

In this patch, functions that should always take an argument still use
$1. Functions that have optional arguments use ${1-}.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 09:33:26 -08:00
..
git-completion.bash bash-completion: Support running when set -u is enabled 2009-01-15 09:33:26 -08:00