From 3bb69b1dd8729fc61276966526f2e87671001f08 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Feb 2010 00:19:07 +0100 Subject: [PATCH] post-checkout-hook: handle paths with spaces in the file names This was reported by Kirill in issue 415. Signed-off-by: Johannes Schindelin --- share/msysGit/post-checkout-hook | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/msysGit/post-checkout-hook b/share/msysGit/post-checkout-hook index 1ac211d8..6aca7a1b 100644 --- a/share/msysGit/post-checkout-hook +++ b/share/msysGit/post-checkout-hook @@ -63,10 +63,12 @@ die () { test -s /etc/modifiedFiles && { echo "Trying to finish checkout" >&2 cat /etc/modifiedFiles | - xargs git checkout -- || + tr "\n" "\0" | + xargs -0r git checkout -- || die "Please close _all_ msysGit instances and run this shortcut again" test -z "$(cat /etc/modifiedFiles | - xargs git diff --ignore-submodules --name-only)" || + tr "\n" "\0" | + xargs -0r git diff --ignore-submodules --name-only)" || die "At least one file could not be updated; is msysGit still running?" } -- 2.11.4.GIT