From 747b60cf3756ac26912cb2534fcdc89e6a19abeb Mon Sep 17 00:00:00 2001 From: Tyler Levine Date: Mon, 14 Mar 2016 12:45:00 -0700 Subject: [PATCH] Use >| operator in _rebuild_git_index when overwriting .git_index file If the shell has the noclobber option set, s --rebuild will fail to update the .git_index file. Using the >| operator instead of the > operator forces the .git_index file to be clobbered, which is the desired behavior. --- 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 44964f9..bf37b55 100644 --- a/lib/git/repo_index.sh +++ b/lib/git/repo_index.sh @@ -149,7 +149,7 @@ function _rebuild_git_index() { IFS=$'\n' 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" + done | sort | cut -d " " -f2- >| "$GIT_REPO_DIR/.git_index" IFS=$' \t\n' if [ "$1" != "--silent" ]; then