summaryrefslogtreecommitdiff
path: root/vcs-svn/fast_export.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-12-11 23:08:51 (GMT)
committerJonathan Nieder <jrnieder@gmail.com>2011-03-07 07:43:58 (GMT)
commit1ae469b06c50aade4781931ca1587453082f57eb (patch)
tree2382f8a7fba8042094676ea3f29d7db85581e52e /vcs-svn/fast_export.c
parente43581120843f6f55f411af470faf806e052ad9d (diff)
downloadgit-1ae469b06c50aade4781931ca1587453082f57eb.zip
git-1ae469b06c50aade4781931ca1587453082f57eb.tar.gz
git-1ae469b06c50aade4781931ca1587453082f57eb.tar.bz2
vcs-svn: handle filenames with dq correctly
Quote paths passed to fast-import so filenames with double quotes are not misinterpreted. One might imagine this could help with filenames with newlines, too, but svn does not allow those. Helped-by: David Barr <daivd.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'vcs-svn/fast_export.c')
-rw-r--r--vcs-svn/fast_export.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 4d57efa..9c03f3e 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -34,10 +34,9 @@ void fast_export_reset(void)
void fast_export_delete(uint32_t depth, const uint32_t *path)
{
- putchar('D');
- putchar(' ');
- pool_print_seq(depth, path, '/', stdout);
- putchar('\n');
+ printf("D \"");
+ pool_print_seq_q(depth, path, '/', stdout);
+ printf("\"\n");
}
static void fast_export_truncate(uint32_t depth, const uint32_t *path, uint32_t mode)
@@ -54,9 +53,9 @@ void fast_export_modify(uint32_t depth, const uint32_t *path, uint32_t mode,
fast_export_truncate(depth, path, mode);
return;
}
- printf("M %06"PRIo32" %s ", mode, dataref);
- pool_print_seq(depth, path, '/', stdout);
- putchar('\n');
+ printf("M %06"PRIo32" %s \"", mode, dataref);
+ pool_print_seq_q(depth, path, '/', stdout);
+ printf("\"\n");
}
static char gitsvnline[MAX_GITSVN_LINE_LEN];
@@ -97,9 +96,9 @@ void fast_export_end_commit(uint32_t revision)
static void ls_from_rev(uint32_t rev, uint32_t depth, const uint32_t *path)
{
/* ls :5 path/to/old/file */
- printf("ls :%"PRIu32" ", rev);
- pool_print_seq(depth, path, '/', stdout);
- putchar('\n');
+ printf("ls :%"PRIu32" \"", rev);
+ pool_print_seq_q(depth, path, '/', stdout);
+ printf("\"\n");
fflush(stdout);
}