git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
commit34d8f5a8aa4aa17af3158f325173eb08c9c05eb1
authorVille Skyttä <ville.skytta@iki.fi>
Mon, 6 Jun 2016 16:29:33 +0000 (6 19:29 +0300)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2016 20:09:07 +0000 (6 13:09 -0700)
tree27faadbbf1553347c30e54ae3892e094f4007ca4
parente568e563ade00bbb0937162f405fc160f253e224
git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha

When the shell is in "nounset" or "set -u" mode, referencing unset or
null variables results in an error. Protect $ZSH_VERSION and
$BASH_VERSION against that, and initialize $short_sha before use.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-prompt.sh