summaryrefslogtreecommitdiff
path: root/builtin/sparse-checkout.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-01-31 20:16:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-31 21:05:29 (GMT)
commite55682ea2640dd3aa002a2657c32bdd1d85b44e9 (patch)
treec9fa0d126b1261bf9c78390a1018945819a84862 /builtin/sparse-checkout.c
parentbd64de42de28e5cdda7765d5de1c3ed34d4898cb (diff)
downloadgit-e55682ea2640dd3aa002a2657c32bdd1d85b44e9.zip
git-e55682ea2640dd3aa002a2657c32bdd1d85b44e9.tar.gz
git-e55682ea2640dd3aa002a2657c32bdd1d85b44e9.tar.bz2
sparse-checkout: use C-style quotes in 'list' subcommand
When in cone mode, the 'git sparse-checkout list' subcommand lists the directories included in the sparse cone. When these directories contain odd characters, such as a backslash, then we need to use C-style quotes similar to 'git ls-tree'. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/sparse-checkout.c')
-rw-r--r--builtin/sparse-checkout.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 6083aa1..facdb6b 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -78,8 +78,10 @@ static int sparse_checkout_list(int argc, const char **argv)
string_list_sort(&sl);
- for (i = 0; i < sl.nr; i++)
- printf("%s\n", sl.items[i].string);
+ for (i = 0; i < sl.nr; i++) {
+ quote_c_style(sl.items[i].string, NULL, stdout, 0);
+ printf("\n");
+ }
return 0;
}