Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue with aliases that have no args

  • Loading branch information...
commit 53aba36670aadd93504614e0f6e58dfdbaaa54e8 1 parent 07267f5
@ndbroadbent authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/git/aliases.sh
View
8 lib/git/aliases.sh
@@ -65,9 +65,13 @@ _git
__git_alias () {
if [ -n "$1" ]; then
local alias_str cmd_prefix cmd cmd_args
+
alias_str="$1"; cmd_prefix="$2"; cmd="$3";
- shift 3 2>/dev/null
- cmd_args=$@
+ if [ $# -gt 2 ]; then
+ shift 3 2>/dev/null
+ cmd_args=$@
+ fi
+
alias $alias_str="$cmd_prefix $cmd${cmd_args:+ }${cmd_args[*]}"
if [ "$shell" = "bash" ]; then
__define_git_completion "$alias_str" "$cmd"
Please sign in to comment.
Something went wrong with that request. Please try again.