Skip to content

Commit

Permalink
Merge branch 'js/fast-export-paths-with-spaces'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Jul 9, 2012
2 parents 45c96c0 + ff59f6d commit f8a9eaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions builtin/fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion t/t9350-fast-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit f8a9eaf

Please sign in to comment.