Commits

Anonymous committed 12d1ea2 Merge

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

  • Participants
  • Parent commits 9ea5c63, ff59f6d

Comments (0)

Files changed (2)

File builtin/fast-export.c

 	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);
 }

File t/t9350-fast-export.sh

 	 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 &&