contrib: completion: fix 'eread()' namespace

Otherwise it might collide with a function of the same name in the
user's environment.

Suggested-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Felipe Contreras 2014-05-13 08:21:19 -05:00 committed by Junio C Hamano
parent 59d3924fbb
commit 66ab301c16

View File

@ -259,7 +259,7 @@ __git_ps1_colorize_gitstring ()
r="$c_clear$r" r="$c_clear$r"
} }
eread () __git_eread ()
{ {
f="$1" f="$1"
shift shift
@ -328,9 +328,9 @@ __git_ps1 ()
local step="" local step=""
local total="" local total=""
if [ -d "$g/rebase-merge" ]; then if [ -d "$g/rebase-merge" ]; then
eread "$g/rebase-merge/head-name" b __git_eread "$g/rebase-merge/head-name" b
eread "$g/rebase-merge/msgnum" step __git_eread "$g/rebase-merge/msgnum" step
eread "$g/rebase-merge/end" total __git_eread "$g/rebase-merge/end" total
if [ -f "$g/rebase-merge/interactive" ]; then if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i" r="|REBASE-i"
else else
@ -338,10 +338,10 @@ __git_ps1 ()
fi fi
else else
if [ -d "$g/rebase-apply" ]; then if [ -d "$g/rebase-apply" ]; then
eread "$g/rebase-apply/next" step __git_eread "$g/rebase-apply/next" step
eread "$g/rebase-apply/last" total __git_eread "$g/rebase-apply/last" total
if [ -f "$g/rebase-apply/rebasing" ]; then if [ -f "$g/rebase-apply/rebasing" ]; then
eread "$g/rebase-apply/head-name" b __git_eread "$g/rebase-apply/head-name" b
r="|REBASE" r="|REBASE"
elif [ -f "$g/rebase-apply/applying" ]; then elif [ -f "$g/rebase-apply/applying" ]; then
r="|AM" r="|AM"
@ -365,7 +365,7 @@ __git_ps1 ()
b="$(git symbolic-ref HEAD 2>/dev/null)" b="$(git symbolic-ref HEAD 2>/dev/null)"
else else
local head="" local head=""
if ! eread "$g/HEAD" head; then if ! __git_eread "$g/HEAD" head; then
if [ $pcmode = yes ]; then if [ $pcmode = yes ]; then
PS1="$ps1pc_start$ps1pc_end" PS1="$ps1pc_start$ps1pc_end"
fi fi