Skip to content

Commit

Permalink
completion: simplify __gitcomp_1
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Apr 22, 2012
1 parent 74a8c84 commit 3bf421e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ __git_ps1 ()
fi
}

# __gitcomp_1 requires 2 arguments
__gitcomp_1 ()
{
local c IFS=' '$'\t'$'\n'
local c IFS=$' \t\n'
for c in $1; do
case "$c$2" in
--*=*) printf %s$'\n' "$c$2" ;;
*.) printf %s$'\n' "$c$2" ;;
*) printf %s$'\n' "$c$2 " ;;
c="$c$2"
case $c in
--*=*|*.) ;;
*) c="$c " ;;
esac
printf '%s\n' "$c"
done
}

Expand Down

0 comments on commit 3bf421e

Please sign in to comment.