summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-03-11 10:32:16 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-03-11 10:32:16 -0700
commitf1eba9f055f59ea7a04b4bb45facc1c64abc2132 (patch)
tree113c841f6b8f289d05adccd9f145474aaa5bbe47
parentMerge branch 'mm/add-u-A-finishing-touches' (diff)
parentgit-completion.bash: zsh does not implement function redirection correctly (diff)
downloadtgif-f1eba9f055f59ea7a04b4bb45facc1c64abc2132.tar.xz
Merge branch 'mp/complete-paths'
* mp/complete-paths: git-completion.bash: zsh does not implement function redirection correctly
-rw-r--r--contrib/completion/git-completion.bash16
1 files changed, 11 insertions, 5 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b62bec0279..93eba46750 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -299,9 +299,12 @@ __git_index_file_list_filter ()
# the second argument.
__git_ls_files_helper ()
{
- # NOTE: $2 is not quoted in order to support multiple options
- cd "$1" && git ls-files --exclude-standard $2
-} 2>/dev/null
+ (
+ test -n "${CDPATH+set}" && unset CDPATH
+ # NOTE: $2 is not quoted in order to support multiple options
+ cd "$1" && git ls-files --exclude-standard $2
+ ) 2>/dev/null
+}
# Execute git diff-index, returning paths relative to the directory
@@ -309,8 +312,11 @@ __git_ls_files_helper ()
# specified in the second argument.
__git_diff_index_helper ()
{
- cd "$1" && git diff-index --name-only --relative "$2"
-} 2>/dev/null
+ (
+ test -n "${CDPATH+set}" && unset CDPATH
+ cd "$1" && git diff-index --name-only --relative "$2"
+ ) 2>/dev/null
+}
# __git_index_files accepts 1 or 2 arguments:
# 1: Options to pass to ls-files (required).