Use builtin cd for batch commands

This commit is contained in:
Nathan Broadbent
2012-01-31 00:11:10 +08:00
parent 66ac5c4e7b
commit ada316bd5b

View File

@@ -260,13 +260,13 @@ function _git_index_batch_cmd() {
unset IFS unset IFS
local base_path local base_path
for base_path in $(sed -e "s/--.*//" "$GIT_REPO_DIR/.git_index" | grep . | sort); do 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 done
else else
echo "Please give a command to run for all repos. (It may be useful to write your command as a function or script.)" echo "Please give a command to run for all repos. (It may be useful to write your command as a function or script.)"
fi fi
"cd" "$cwd" builtin cd "$cwd"
} }