diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-22 13:00:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-22 13:00:45 -0700 |
commit | 12d1ea21c06b49843366bd5c992d2fa79433e33f (patch) | |
tree | 8d4ae909ba89b6d4bd1aca6d20ec3029eec23ebe | |
parent | 9ea5c632da283ff8c2dea8176cd34f1c8618d6c4 (diff) | |
parent | ff59f6da840bb58058fef06721a2646daae50509 (diff) | |
download | git-12d1ea21c06b49843366bd5c992d2fa79433e33f.tar.gz git-12d1ea21c06b49843366bd5c992d2fa79433e33f.tar.xz |
Merge branch 'js/fast-export-paths-with-spaces' into maint
"git fast-export" produced an input stream for fast-import without
properly quoting pathnames when they contain SPs in them.
* js/fast-export-paths-with-spaces:
fast-export: quote paths with spaces
-rw-r--r-- | builtin/fast-export.c | 2 | ||||
-rwxr-xr-x | t/t9350-fast-export.sh | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c index ef7c01209..9ab6db3fb 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 77447b70f..3e821f958 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 && |