git fast-import: Empty path component found in input

When you get “fatal: Empty path component found in input” errors from git fast-import, check that your export tool doesn’t write out path values that start with a slash. In my case, my rule file for svn-all-fast-export matched paths like “/project/trunk”, when I should’ve used “/project/trunk/” (note the trailing slash).

Pro-Tip for svn-all-fast-export: Use –metadata=no to get rid of the svn info in the generated git commits. It’s not really advertised as an option.