aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-09 00:30:58 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-09 00:30:58 +1200
commit299f7b611b2a757098e5ccd3b439d94d1e2c309c (patch)
treebbab21c2770f4701be1651701d8aa520aff04183 /bash
parentUse double-glob to get all refs (diff)
downloaddotfiles-299f7b611b2a757098e5ccd3b439d94d1e2c309c.tar.gz
dotfiles-299f7b611b2a757098e5ccd3b439d94d1e2c309c.zip
Add IFS clearing before filename/branch reads
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/git.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash
index ba8e5d59..8e10910b 100644
--- a/bash/bash_completion.d/git.bash
+++ b/bash/bash_completion.d/git.bash
@@ -39,7 +39,7 @@ _git() {
# Complete with untracked, unignored files
add)
local file
- while read -rd '' file ; do
+ while IFS= read -rd '' file ; do
[[ -n $file ]] || continue
COMPREPLY[${#COMPREPLY[@]}]=$file
done < <(git ls-files \
@@ -55,7 +55,7 @@ _git() {
# Complete with ref names
*)
local ref
- while read -r ref ; do
+ while IFS= read -r ref ; do
[[ -n $ref ]] || continue
COMPREPLY[${#COMPREPLY[@]}]=${ref#refs/*/}
done < <(git for-each-ref \