From 89e204744219178b03daa331b9dabe0171142eae Mon Sep 17 00:00:00 2001 From: Jonhnny Weslley Date: Wed, 10 Nov 2010 12:22:49 -0300 Subject: [PATCH] Fixes multiple matches selection Signed-off-by: Tj Holowaychuk --- bin/git-ignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-ignore b/bin/git-ignore index 47f084a..fbc159c 100755 --- a/bin/git-ignore +++ b/bin/git-ignore @@ -9,7 +9,7 @@ done if [ ! -z "$template" ]; then gitignoredir="`dirname $0`/../etc/gitignore" - selected_template=$(find $gitignoredir -type f -name *.gitignore | xargs -i basename {} .gitignore | grep -i $template) + selected_template=$(find $gitignoredir -type f -name *.gitignore | xargs -i basename {} .gitignore | sort | grep $template) count=$(echo $selected_template | wc -w) case "$count" in 0) echo "The pattern '$template' does not match any available templates." && exit 1;;