From ada316bd5bbc6d23eb686bfac879c175cbca4171 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 31 Jan 2012 00:11:10 +0800 Subject: [PATCH] Use builtin cd for batch commands --- lib/git/repo_index.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git/repo_index.sh b/lib/git/repo_index.sh index 4aa19a7..1e14b0e 100644 --- a/lib/git/repo_index.sh +++ b/lib/git/repo_index.sh @@ -260,13 +260,13 @@ function _git_index_batch_cmd() { unset IFS local base_path for base_path in $(sed -e "s/--.*//" "$GIT_REPO_DIR/.git_index" | grep . | sort); do - if [ -z "$NOCD" ]; then "cd" "$base_path"; fi + builtin cd "$base_path" $@ done else echo "Please give a command to run for all repos. (It may be useful to write your command as a function or script.)" fi - "cd" "$cwd" + builtin cd "$cwd" }