Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit c9faaa4

Browse files
author
Matthew McCullough
committed
Handle spaces in path names in git dirty repository finder
1 parent 4d91a68 commit c9faaa4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git-finddirty

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# Very verbose mode that outputs what files are dirty
1414
##############################################################################
1515

16+
# Preserve the old input field separator
17+
OLDIFS=$IFS
18+
# Change the input field separator from a space to a null
19+
IFS=$'\n'
20+
1621
# Find all directories that have a .git directory in them
1722
for gitprojpath in `find . -type d -name .git | sort | sed "s/\/\.git//"`; do
1823
# 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
3944
# Return to the starting directory, suppressing the output
4045
popd >/dev/null
4146
done
47+
48+
# restore the input field separator
49+
IFS=$OLDIFS

0 commit comments

Comments
 (0)