Only expand args for a subset of git commands

This commit is contained in:
Nathan Broadbent
2012-08-13 11:24:40 +12:00
parent 44b1adfd28
commit d092c51aa6

View File

@@ -14,7 +14,13 @@ if type hub > /dev/null 2>&1; then _git_cmd=hub; fi
# Create 'git' function that calls hub if defined, and expands all numeric arguments # Create 'git' function that calls hub if defined, and expands all numeric arguments
function git(){ function git(){
exec_git_expand_args "$_git_cmd" "$@" # Only expand args for a subset of git commands
case $1 in
checkout|commit|reset|rm|blame|diff|add|log)
exec_git_expand_args "$_git_cmd" "$@";;
*)
"$_git_cmd" "$@";;
esac
} }
_alias $git_alias='git' _alias $git_alias='git'