From 9e701a18e5314766094ea5557e4c3b63f9d916ad Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 20 Dec 2011 11:29:44 +0800 Subject: [PATCH] Fixed case where more than one project matched the completed word --- lib/git/repo_index.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/repo_index.sh b/lib/git/repo_index.sh index eecb634..445de51 100644 --- a/lib/git/repo_index.sh +++ b/lib/git/repo_index.sh @@ -85,7 +85,7 @@ function git_index() { # Figure out which directory we need to change to. local project=$(echo $1 | cut -d "/" -f1) # Find base path of project - local base_path="$(grep "/$project$" "$GIT_REPO_DIR/.git_index")" + local base_path="$(grep -m1 "/$project$" "$GIT_REPO_DIR/.git_index")" if [ -n "$base_path" ]; then sub_path=$(echo $1 | sed "s:^$project::") # Append subdirectories to base path