Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle spaces in path names in git dirty repository finder

  • Loading branch information...
commit c9faaa4ede5136c4c87ea179f535680828e2e8f1 1 parent 4d91a68
@matthewmccullough authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 git-finddirty
View
8 git-finddirty
@@ -13,6 +13,11 @@
# Very verbose mode that outputs what files are dirty
##############################################################################
+# Preserve the old input field separator
+OLDIFS=$IFS
+# Change the input field separator from a space to a null
+IFS=$'\n'
+
# Find all directories that have a .git directory in them
for gitprojpath in `find . -type d -name .git | sort | sed "s/\/\.git//"`; do
# Save the current working directory before CDing for git's purpose
@@ -39,3 +44,6 @@ for gitprojpath in `find . -type d -name .git | sort | sed "s/\/\.git//"`; do
# Return to the starting directory, suppressing the output
popd >/dev/null
done
+
+# restore the input field separator
+IFS=$OLDIFS
Please sign in to comment.
Something went wrong with that request. Please try again.