Skip to content

Commit 3bf421e

Browse files
felipecgitster
authored andcommitted
completion: simplify __gitcomp_1
Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74a8c84 commit 3bf421e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/completion/git-completion.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,16 @@ __git_ps1 ()
304304
fi
305305
}
306306

307-
# __gitcomp_1 requires 2 arguments
308307
__gitcomp_1 ()
309308
{
310-
local c IFS=' '$'\t'$'\n'
309+
local c IFS=$' \t\n'
311310
for c in $1; do
312-
case "$c$2" in
313-
--*=*) printf %s$'\n' "$c$2" ;;
314-
*.) printf %s$'\n' "$c$2" ;;
315-
*) printf %s$'\n' "$c$2 " ;;
311+
c="$c$2"
312+
case $c in
313+
--*=*|*.) ;;
314+
*) c="$c " ;;
316315
esac
316+
printf '%s\n' "$c"
317317
done
318318
}
319319

0 commit comments

Comments
 (0)