diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 9836e6b7ca22e254c06d8d766d510ef43a8cbe90..e8a07c95e11dd4e8a305f586b3aafbda84c34a28 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -185,6 +185,8 @@ static void print_path(const char *path) int need_quote = quote_c_style(path, NULL, NULL, 0); if (need_quote) quote_c_style(path, NULL, stdout, 0); + else if (strchr(path, ' ')) + printf("\"%s\"", path); else printf("%s", path); } diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 950d0ff498fda58c2d3d68dfb2cf50512f8f81ba..79deef98870e4fdefc4989c09a24f2b9c8aad600 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -430,7 +430,7 @@ test_expect_success 'fast-export quotes pathnames' ' git commit -m rename && git read-tree --empty && git commit -m deletion && - git fast-export HEAD >export.out && + git fast-export -M HEAD >export.out && git rev-list HEAD >expect && git init result && cd result &&