diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2020-02-11 18:02:24 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-11 20:06:47 +0300 |
commit | ef07659926f64d70e8cb41025c3d7456eecb962e (patch) | |
tree | 975f25bbaaebd3a374888a7e169e8d4a14f3dc9a /builtin/sparse-checkout.c | |
parent | 2631dc879d59aa08095bc4fb5bc9bcc491a787e9 (diff) |
sparse-checkout: work with Windows paths
When using Windows, a user may run 'git sparse-checkout set A\B\C'
to add the Unix-style path A/B/C to their sparse-checkout patterns.
Normalizing the input path converts the backslashes to slashes before we
add the string 'A/B/C' to the recursive hashset.
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index af9e3e5123..3e314e3358 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -394,6 +394,9 @@ static void strbuf_to_cone_pattern(struct strbuf *line, struct pattern_list *pl) strbuf_trim_trailing_dir_sep(line); + if (strbuf_normalize_path(line)) + die(_("could not normalize path %s"), line->buf); + if (!line->len) return; |