Update zgitinit with more quoting
This commit is contained in:
parent
17fbfec253
commit
0ae59e8afe
1 changed files with 8 additions and 8 deletions
|
|
@ -66,23 +66,23 @@ zgit_head() {
|
||||||
|
|
||||||
if [ -z "$zgit_info[head]" ]; then
|
if [ -z "$zgit_info[head]" ]; then
|
||||||
local name=''
|
local name=''
|
||||||
name=$(git symbolic-ref -q HEAD)
|
name="$(git symbolic-ref -q HEAD)"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [[ $name == refs/(heads|tags)/* ]]; then
|
if [[ "$name" == refs/(heads|tags)/* ]]; then
|
||||||
name=${name#refs/(heads|tags)/}
|
name="${name#refs/(heads|tags)/}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
name=$(git name-rev --name-only --no-undefined --always HEAD)
|
name="$(git name-rev --name-only --no-undefined --always HEAD)"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
return 1
|
return 1
|
||||||
elif [[ $name == remotes/* ]]; then
|
elif [[ "$name" == remotes/* ]]; then
|
||||||
name=${name#remotes/}
|
name="${name#remotes/}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
zgit_info[head]=$name
|
zgit_info[head]="$name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $zgit_info[head]
|
echo "$zgit_info[head]"
|
||||||
}
|
}
|
||||||
|
|
||||||
zgit_branch() {
|
zgit_branch() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue