From aca96a5e8cfce41608d4b340dd4da0016e402f4e Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 8 Mar 2012 17:35:03 +0800 Subject: [PATCH] Fix defaut IFS for Ubuntu 11.x --- lib/design.sh | 2 +- lib/git/fallback/status_shortcuts_shell.sh | 2 +- lib/git/repo_index.sh | 14 +++++++------- lib/git/status_shortcuts.sh | 4 ++-- test/lib/git/repo_index_test.sh | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/design.sh b/lib/design.sh index bae3e68..e637a49 100644 --- a/lib/design.sh +++ b/lib/design.sh @@ -33,7 +33,7 @@ design() { local project=`basename $(pwd)` local all_project_dirs="$design_base_dirs $design_av_dirs" # Ensure design dir contains all subdirectories - unset IFS + IFS=$' \t\n' # Create root design dirs for dir in $design_ext_dirs; do mkdir -p "$root_design_dir/$dir"; done # Create project design dirs diff --git a/lib/git/fallback/status_shortcuts_shell.sh b/lib/git/fallback/status_shortcuts_shell.sh index 2e4025a..ae77c66 100644 --- a/lib/git/fallback/status_shortcuts_shell.sh +++ b/lib/git/fallback/status_shortcuts_shell.sh @@ -114,7 +114,7 @@ git_status_shortcuts() { # so just use plain 'git status' git status fi - unset IFS + IFS=$' \t\n' zsh_reset # Reset zsh environment to default } # Template function for 'git_status_shortcuts'. diff --git a/lib/git/repo_index.sh b/lib/git/repo_index.sh index f3d616c..10b8091 100644 --- a/lib/git/repo_index.sh +++ b/lib/git/repo_index.sh @@ -99,7 +99,7 @@ function git_index() { # -------------------- # Go to our base path if [ -n "$base_path" ]; then - unset IFS + IFS=$' \t\n' # evaluate ~ if necessary if [[ "$base_path" == "~"* ]]; then base_path=$(eval echo ${base_path%%/*})/${base_path#*/} @@ -112,7 +112,7 @@ function git_index() { fi fi fi - unset IFS + IFS=$' \t\n' } _git_index_dirs_without_home() { @@ -127,7 +127,7 @@ function _find_git_repos() { echo ${repo%/.git} # Return project folder, with trailing ':' _find_git_submodules $repo # Detect any submodules done - unset IFS + IFS=$' \t\n' } # List all submodules for a git repo, if any. @@ -146,7 +146,7 @@ function _rebuild_git_index() { for repo in $(echo -e "$(_find_git_repos)\n$(echo $GIT_REPOS | sed "s/:/\\\\n/g")"); do echo $(basename $repo | sed "s/ /_/g") $repo done | sort | cut -d " " -f2- > "$GIT_REPO_DIR/.git_index" - unset IFS + IFS=$' \t\n' if [ "$1" != "--silent" ]; then echo -e "===== Indexed $_bld_col$(_git_index_count)$_txt_col repos in $GIT_REPO_DIR/.git_index" @@ -218,7 +218,7 @@ _git_index_update_all_branches() { echo "=== Skipping $branch: remote and merge refs are not configured." fi done - unset IFS + IFS=$' \t\n' # Update all remotes if there are any branches to update if [ -n "${branches[*]}" ]; then git fetch --all 2> /dev/null; fi @@ -257,7 +257,7 @@ function _git_index_batch_cmd() { cwd="$PWD" if [ -n "$1" ]; then echo -e "== Running command for $_bld_col$(_git_index_count)$_txt_col repos...\n" - unset IFS + IFS=$' \t\n' local base_path for base_path in $(sed -e "s/--.*//" "$GIT_REPO_DIR/.git_index" | grep . | sort); do builtin cd "$base_path" @@ -303,7 +303,7 @@ function _git_index_tab_completion() { else COMPREPLY=($(compgen -W '$(sed -e "s:.*/::" -e "s:$:/:" "$GIT_REPO_DIR/.git_index" | sort)' -- $curw)) fi - unset IFS + IFS=$' \t\n' return 0 } diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh index 5f74217..5d4bbe3 100644 --- a/lib/git/status_shortcuts.sh +++ b/lib/git/status_shortcuts.sh @@ -40,7 +40,7 @@ git_status_shortcuts() { if [ "$scmbDebug" = "true" ]; then echo "Set \$$git_env_char$e => $file"; fi let e++ done - unset IFS + IFS=$' \t\n' if [ "$scmbDebug" = "true" ]; then echo "------------------------"; fi # Print status @@ -115,7 +115,7 @@ git_silent_add_patch_shortcuts() { git add -p "$file" echo -e "# add '$file'" done - unset IFS + IFS=$' \t\n' echo "#" fi } diff --git a/test/lib/git/repo_index_test.sh b/test/lib/git/repo_index_test.sh index 46100e1..dcf1b0c 100755 --- a/test/lib/git/repo_index_test.sh +++ b/test/lib/git/repo_index_test.sh @@ -63,7 +63,7 @@ EOF for dir in $GIT_REPOS; do mkdir -p $dir; cd $dir; git init; done - unset IFS + IFS=$' \t\n' verboseGitCommands @@ -74,7 +74,7 @@ oneTimeTearDown() { rm -rf "${GIT_REPO_DIR}" IFS=":" for dir in $GIT_REPOS; do rm -rf $dir; done - unset IFS + IFS=$' \t\n' } ensureIndex() {