aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-22 15:30:38 -0800
committerJunio C Hamano <gitster@pobox.com>2011-12-22 15:30:38 -0800
commit2b6dd6a2a8dbc0492fc766a1585488b13bbce10e (patch)
treecc31235ddd14e18d6595236ce64955b3e3ec1088 /contrib
parent35726681d5fd6bde44a18b4aec3cf04258d0b44e (diff)
parent6f2dd720b68ee8df0afae92e96001c8d3f14c1dc (diff)
downloadgit-2b6dd6a2a8dbc0492fc766a1585488b13bbce10e.tar.gz
git-2b6dd6a2a8dbc0492fc766a1585488b13bbce10e.tar.xz
Merge branch 'tr/bash-read-unescaped'
* tr/bash-read-unescaped: bash completion: use read -r everywhere
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index cc1bdf960..b0062bac2 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -111,7 +111,7 @@ __git_ps1_show_upstream ()
# get some config options from git-config
local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
- while read key value; do
+ while read -r key value; do
case "$key" in
bash.showupstream)
GIT_PS1_SHOWUPSTREAM="$value"
@@ -589,7 +589,7 @@ __git_refs ()
local ref entry
git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \
"refs/remotes/" | \
- while read entry; do
+ while read -r entry; do
eval "$entry"
ref="${ref#*/}"
if [[ "$ref" == "$cur"* ]]; then
@@ -602,7 +602,7 @@ __git_refs ()
case "$cur" in
refs|refs/*)
git ls-remote "$dir" "$cur*" 2>/dev/null | \
- while read hash i; do
+ while read -r hash i; do
case "$i" in
*^{}) ;;
*) echo "$i" ;;
@@ -611,7 +611,7 @@ __git_refs ()
;;
*)
git ls-remote "$dir" HEAD ORIG_HEAD 'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev/null | \
- while read hash i; do
+ while read -r hash i; do
case "$i" in
*^{}) ;;
refs/*) echo "${i#refs/*/}" ;;
@@ -636,7 +636,7 @@ __git_refs_remotes ()
{
local i hash
git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \
- while read hash i; do
+ while read -r hash i; do
echo "$i:refs/remotes/$1/${i#refs/heads/}"
done
}
@@ -1863,7 +1863,7 @@ __git_config_get_set_variables ()
done
git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null |
- while read line
+ while read -r line
do
case "$line" in
*.*=*)