66
__git ()
67
{
68
git ${__git_C_args:+"${__git_C_args[@]}"} \
69
- ${__git_dir:+--git-dir="$__git_dir"} "$@"
69
+ ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null
70
}
71
72
# The following function is based on code from:
300
else
301
# NOTE: $2 is not quoted in order to support multiple options
302
__git -C "$1" ls-files --exclude-standard $2
303
- fi 2>/dev/null
303
+ fi
304
}
305
306
410
fi
411
case "$cur" in
412
refs|refs/*)
413
- __git ls-remote "$remote" "$cur*" 2>/dev/null | \
413
+ __git ls-remote "$remote" "$cur*" | \
414
while read -r hash i; do
415
case "$i" in
416
*^{}) ;;
422
if [ "$list_refs_from" = remote ]; then
423
echo "HEAD"
424
__git for-each-ref --format="%(refname:short)" \
425
- "refs/remotes/$remote/" 2>/dev/null | sed -e "s#^$remote/##"
425
+ "refs/remotes/$remote/" | sed -e "s#^$remote/##"
426
else
427
__git ls-remote "$remote" HEAD \
428
- "refs/tags/*" "refs/heads/*" "refs/remotes/*" 2>/dev/null |
428
+ "refs/tags/*" "refs/heads/*" "refs/remotes/*" |
429
while read -r hash i; do
430
case "$i" in
431
*^{}) ;;
451
__git_refs_remotes ()
452
{
453
local i hash
454
- __git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \
454
+ __git ls-remote "$1" 'refs/heads/*' | \
455
while read -r hash i; do
456
echo "$i:refs/remotes/$1/${i#refs/heads/}"
457
done
527
*) pfx="$ref:$pfx" ;;
528
esac
529
530
- __gitcomp_nl "$(__git ls-tree "$ls" 2>/dev/null \
530
+ __gitcomp_nl "$(__git ls-tree "$ls" \
531
| sed '/^100... blob /{
532
s,^.* ,,
533
s,$, ,
805
__git_get_config_variables ()
806
{
807
local section="$1" i IFS=$'\n'
808
- for i in $(__git config --name-only --get-regexp "^$section\..*" 2>/dev/null); do
808
+ for i in $(__git config --name-only --get-regexp "^$section\..*"); do
809
echo "${i#$section.}"
810
done
811
}
823
# __git_aliased_command requires 1 argument
824
__git_aliased_command ()
825
{
826
- local word cmdline=$(__git config --get "alias.$1" 2>/dev/null)
826
+ local word cmdline=$(__git config --get "alias.$1")
827
for word in $cmdline; do
828
case "$word" in
829
\!gitk|gitk)
1841
{
1842
case "$prev" in
1843
--to|--cc|--bcc|--from)
1844
- __gitcomp "
1845
- $(__git send-email --dump-aliases 2>/dev/null)
1846
- "
1844
+ __gitcomp "$(__git send-email --dump-aliases)"
1845
return
1846
;;
1847
esac
1871
return
1872
;;
1873
--to=*|--cc=*|--bcc=*|--from=*)
1876
- __gitcomp "
1877
- $(__git send-email --dump-aliases 2>/dev/null)
1878
- " "" "${cur#--*=}"
1874
+ __gitcomp "$(__git send-email --dump-aliases)" "" "${cur#--*=}"
1875
return
1876
;;
1877
--*)
1965
c=$((--c))
1966
done
1967
1972
- __git config $config_file --name-only --list 2>/dev/null
1968
+ __git config $config_file --name-only --list
1969
}
1970
1971
_git_config ()