diff options
author | Jeff King <peff@peff.net> | 2011-08-05 16:36:22 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-05 15:56:54 -0700 |
commit | 6280dfdc3b22aa821521182781e5a247b19fb515 (patch) | |
tree | 558e2c5187a36ad5710eae064d3b6acd99ada98b /t/t4013/diff.log_-p_master | |
parent | Merge branch 'maint-1.7.2' into maint-1.7.3 (diff) | |
download | tgif-6280dfdc3b22aa821521182781e5a247b19fb515.tar.xz |
fast-export: quote paths in output
Many pathnames in a fast-import stream need to be quoted. In
particular:
1. Pathnames at the end of an "M" or "D" line need quoting
if they contain a LF or start with double-quote.
2. Pathnames on a "C" or "R" line need quoting as above,
but also if they contain spaces.
For (1), we weren't quoting at all. For (2), we put
double-quotes around the paths to handle spaces, but ignored
the possibility that they would need further quoting.
This patch checks whether each pathname needs c-style
quoting, and uses it. This is slightly overkill for (1),
which doesn't actually need to quote many characters that
vanilla c-style quoting does. However, it shouldn't hurt, as
any implementation needs to be ready to handle quoted
strings anyway.
In addition to adding a test, we have to tweak a test which
blindly assumed that case (2) would always use
double-quotes, whether it needed to or not.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.log_-p_master')
0 files changed, 0 insertions, 0 deletions