summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-09-18 17:58:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-09-18 17:58:04 -0700
commit9d4e7ec4d9e695d95cc7474f59fba8cc38580e29 (patch)
tree22db63f4315c0e6698d67c879c73520ef4074c39 /diff.c
parentMerge branch 'os/collect-changed-submodules-optim' (diff)
parentquote: turn 'nodq' parameter into a set of flags (diff)
downloadtgif-9d4e7ec4d9e695d95cc7474f59fba8cc38580e29.tar.xz
Merge branch 'jc/quote-path-cleanup'
"git status --short" quoted a path with SP in it when tracked, but not those that are untracked, ignored or unmerged. They are all shown quoted consistently. * jc/quote-path-cleanup: quote: turn 'nodq' parameter into a set of flags quote: rename misnamed sq_lookup[] to cq_lookup[] wt-status: consistently quote paths in "status --short" output quote_path: code clarification quote_path: optionally allow quoting a path with SP in it quote_path: give flags parameter to quote_path() quote_path: rename quote_path_relative() to quote_path()
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index a5114fa864..ee8e8189e9 100644
--- a/diff.c
+++ b/diff.c
@@ -482,14 +482,14 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
static char *quote_two(const char *one, const char *two)
{
- int need_one = quote_c_style(one, NULL, NULL, 1);
- int need_two = quote_c_style(two, NULL, NULL, 1);
+ int need_one = quote_c_style(one, NULL, NULL, CQUOTE_NODQ);
+ int need_two = quote_c_style(two, NULL, NULL, CQUOTE_NODQ);
struct strbuf res = STRBUF_INIT;
if (need_one + need_two) {
strbuf_addch(&res, '"');
- quote_c_style(one, &res, NULL, 1);
- quote_c_style(two, &res, NULL, 1);
+ quote_c_style(one, &res, NULL, CQUOTE_NODQ);
+ quote_c_style(two, &res, NULL, CQUOTE_NODQ);
strbuf_addch(&res, '"');
} else {
strbuf_addstr(&res, one);